diff --git a/.gitignore b/.gitignore index 6f5101c..11fab6c 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,11 @@ dist dist-bin generated +# Keep committed snapshots of the generated GraphQL/REST artifacts so the +# binary can build without live codegen (the tenant has GraphQL introspection +# disabled, so `bun codegen:gql` cannot regenerate them). +!src/gql/generated/ +!src/rest/generated/ .env !.env.example diff --git a/AGENTS.md b/AGENTS.md index 32b6f6c..1dbe33a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -35,6 +35,8 @@ src/ ├── commands/ # CLI commands organized by resource │ ├── alert/ # Alert commands (list, view) │ ├── auth/ # Auth commands (configure, login, logout, status) +│ ├── board/ # Board (dashboard) commands (create, update, get, list, delete, scaffold, set-default, clear-default) +│ ├── folder/ # Folder commands (create, get, update, delete) │ ├── cli/ # CLI management (install, uninstall, upgrade) │ ├── content/ # Content pack management (experimental: gated + hidden) │ │ ├── host/ # Host Explorer (install, view) @@ -52,6 +54,8 @@ src/ ├── gql/ # GraphQL layer │ ├── generated/ # Auto-generated types (DO NOT EDIT) │ ├── authtoken/ # Auth token mutations +│ ├── board/ # Board (dashboard) queries/mutations (hand-authored; codegen unavailable) +│ ├── folder/ # Folder queries/mutations (hand-authored; codegen unavailable) │ ├── content/ # Content pack queries/mutations │ ├── dataset/ # Dataset queries │ ├── datastream/ # Datastream queries/mutations diff --git a/README.md b/README.md index 50809e6..dfa38f9 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,13 @@ To update installed skills after edits in this repo, run `npx skills update`. ## Commands +> Note: some commands listed below are temporarily disabled in this build. They +> depend on generated GraphQL/REST types that cannot be regenerated while the +> target tenant has GraphQL introspection disabled. They are commented out in +> `src/app.ts` (search for "TEMP: trimmed pending full Observe schema access") +> and will be restored once `bun codegen:gql` can run. The currently active +> commands are: `help`, `dataset`, `alert`, `board`, `folder`, `cli`. + | Command | Description | | --------------------------------------- | ------------------------------------------------------- | | `observe help` | Show help information | @@ -55,6 +62,18 @@ To update installed skills after edits in this repo, run `npx skills update`. | `observe datastream view` | View a datastream by ID | | `observe datastream update` | Update a datastream | | `observe datastream-token check-status` | Poll a datastream token until ingest data arrives | +| `observe board create` | Create a board (dashboard) from a JSON file | +| `observe board update` | Update an existing board from a JSON file | +| `observe board get` | Get a board by ID as JSON | +| `observe board list` | List boards in a workspace | +| `observe board delete` | Delete a board by ID | +| `observe board scaffold` | Print a minimal board JSON template | +| `observe board set-default` | Set the default dashboard for a dataset | +| `observe board clear-default` | Clear the default dashboard for a dataset | +| `observe folder create` | Create a folder (use --ensure to make it idempotent) | +| `observe folder get` | Look up a folder by name and print its ID | +| `observe folder update` | Update a folder's name, description, or icon URL | +| `observe folder delete` | Delete a folder by ID | | `observe cli install` | Configure shell integration (PATH, completions) | | `observe cli uninstall` | Remove shell integration | | `observe cli upgrade` | Upgrade to the latest version | diff --git a/package.json b/package.json index 0c7e89d..b0ea600 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,10 @@ "node": ">=22" }, "scripts": { - "build": "bun run codegen && bun run scripts/build.ts", - "build:single": "bun run codegen && bun run scripts/build.ts --single", + "build": "bun run ifneeded:codegen && bun run scripts/build.ts", + "build:single": "bun run ifneeded:codegen && bun run scripts/build.ts --single", "dev": "bun run ifneeded:codegen && bun run src/bin.ts", - "test": "bun run codegen && bun run typecheck && bun run lint && bun run format && bun test src", + "test": "bun run ifneeded:codegen && bun run typecheck && bun run lint && bun run format && bun test src", "test:integration": "bun test integration/ --concurrent --max-concurrency 5", "typecheck": "tsc", "lint": "eslint", diff --git a/src/app.ts b/src/app.ts index fe6d89c..10d46bc 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,21 +1,34 @@ import { buildApplication } from "@stricli/core"; import { name } from "../package.json"; import { alertRoutes } from "./commands/alert/index.js"; -import { dataConnectionRoutes } from "./commands/data-connection/index.js"; -import { datasourceRoutes } from "./commands/datasource/index.js"; -import { datastreamTokenRoutes } from "./commands/datastream-token/index.js"; -import { authRoutes } from "./commands/auth/index.js"; +// TEMP: trimmed pending full Observe schema access (introspection disabled). Restore when schema available. +// The committed src/gql/generated/graphql.ts snapshot only contains the three +// OPAL operations (CheckQueries, ValidateIngestFilter, VerbsAndFunctions); the +// generated Document constants and result types for every other upstream +// operation are absent and cannot be regenerated (the tenant has GraphQL +// introspection disabled). Every route below whose command modules statically +// import a missing generated GraphQL export therefore fails to load, so they +// are trimmed until schema access is restored and `bun codegen:gql` can run. +// GraphQL-broken: auth (logout->delete-authtoken), metric, query, content, +// ingest-token, datastream, datastream-token. +// Schema-type-broken (skill/tag/datasource/data-connection): as before. +// import { dataConnectionRoutes } from "./commands/data-connection/index.js"; +// import { datasourceRoutes } from "./commands/datasource/index.js"; +// import { datastreamTokenRoutes } from "./commands/datastream-token/index.js"; +// import { authRoutes } from "./commands/auth/index.js"; import { cliRoutes } from "./commands/cli/index.js"; -import { contentRoutes } from "./commands/content/index.js"; +// import { contentRoutes } from "./commands/content/index.js"; import { datasetRoutes } from "./commands/dataset/index.js"; -import { datastreamRoutes } from "./commands/datastream/index.js"; +// import { datastreamRoutes } from "./commands/datastream/index.js"; import { helpCommand } from "./commands/help.js"; -import { ingestTokenRoutes } from "./commands/ingest-token/index.js"; -import { metricRoutes } from "./commands/metric/index.js"; -import { queryCommand } from "./commands/query.js"; -import { skillRoutes } from "./commands/skill/index.js"; -import { tagKeyRoutes } from "./commands/tag-key/index.js"; -import { tagValueRoutes } from "./commands/tag-value/index.js"; +// import { ingestTokenRoutes } from "./commands/ingest-token/index.js"; +// import { metricRoutes } from "./commands/metric/index.js"; +// import { queryCommand } from "./commands/query.js"; +// import { skillRoutes } from "./commands/skill/index.js"; +// import { tagKeyRoutes } from "./commands/tag-key/index.js"; +// import { tagValueRoutes } from "./commands/tag-value/index.js"; +import { boardRoutes } from "./commands/board/index.js"; +import { folderRoutes } from "./commands/folder/index.js"; import { CURRENT_CLI_VERSION } from "./lib/constants.js"; import { defineRoutes } from "./lib/stricli-wrappers.js"; @@ -23,20 +36,23 @@ import { defineRoutes } from "./lib/stricli-wrappers.js"; export const routes = defineRoutes({ routes: { help: helpCommand, - auth: authRoutes, - "tag-value": tagValueRoutes, - "tag-key": tagKeyRoutes, + // TEMP: trimmed pending full Observe schema access (introspection disabled). Restore when schema available. + // auth: authRoutes, + // "tag-value": tagValueRoutes, + // "tag-key": tagKeyRoutes, dataset: datasetRoutes, - metric: metricRoutes, - query: queryCommand, - skill: skillRoutes, + // metric: metricRoutes, + // query: queryCommand, + // skill: skillRoutes, alert: alertRoutes, - content: contentRoutes, - "ingest-token": ingestTokenRoutes, - datasource: datasourceRoutes, - "data-connection": dataConnectionRoutes, - datastream: datastreamRoutes, - "datastream-token": datastreamTokenRoutes, + // content: contentRoutes, + // "ingest-token": ingestTokenRoutes, + // datasource: datasourceRoutes, + // "data-connection": dataConnectionRoutes, + // datastream: datastreamRoutes, + // "datastream-token": datastreamTokenRoutes, + board: boardRoutes, + folder: folderRoutes, cli: cliRoutes, }, defaultCommand: "help", diff --git a/src/commands/board/create.ts b/src/commands/board/create.ts new file mode 100644 index 0000000..b59794a --- /dev/null +++ b/src/commands/board/create.ts @@ -0,0 +1,53 @@ +import { buildCommand } from "@stricli/core"; +import type { LocalContext } from "../../context"; +import { saveBoard } from "../../gql/board/save-board"; +import { GqlApiError } from "../../gql/gql-request"; +import { loadConfig } from "../../lib/config"; +import { readBoardInput } from "./read-input"; +import { boardViewURL } from "./view-url"; + +async function create( + this: LocalContext, + _flags: Record, + file: string, +): Promise { + const { process, writer } = this; + + try { + const config = loadConfig(); + const input = readBoardInput(file); + + const board = await saveBoard(config, input); + + writer.write(`Created: ${board.name} (id: ${board.id})`); + writer.write(`Visibility: ${board.visibility ?? ""}`); + writer.write(`View: ${boardViewURL(config, board.workspaceId, board.id)}`); + } catch (error) { + if (error instanceof GqlApiError) { + writer.error(`API Error (${error.statusCode}): ${error.message}`); + } else { + const message = error instanceof Error ? error.message : String(error); + writer.error(`Error: ${message}`); + } + process.exit(1); + } +} + +export const createCommand = buildCommand({ + loader: async () => create, + parameters: { + positional: { + kind: "tuple", + parameters: [ + { + brief: "Path to a board (dashboard) JSON file", + parse: String, + }, + ], + }, + flags: {}, + }, + docs: { + brief: "Create a board (dashboard) from a JSON file", + }, +}); diff --git a/src/commands/board/delete.ts b/src/commands/board/delete.ts new file mode 100644 index 0000000..7b3861f --- /dev/null +++ b/src/commands/board/delete.ts @@ -0,0 +1,56 @@ +import { buildCommand } from "@stricli/core"; +import type { LocalContext } from "../../context"; +import { deleteBoard } from "../../gql/board/delete-board"; +import { GqlApiError } from "../../gql/gql-request"; +import { loadConfig } from "../../lib/config"; + +async function del( + this: LocalContext, + _flags: Record, + id: string, +): Promise { + const { process, writer } = this; + + try { + const config = loadConfig(); + const result = await deleteBoard(config, id); + + // The API reports success via `success: true` and may populate + // `errorMessage` with a success notice, so only treat it as a failure + // when `success` is explicitly false. + if (result.success === false) { + writer.error(`Error: board delete: ${result.errorMessage ?? "failed"}`); + process.exit(1); + return; + } + + writer.write(`Deleted board ${id}`); + } catch (error) { + if (error instanceof GqlApiError) { + writer.error(`API Error (${error.statusCode}): ${error.message}`); + } else { + const message = error instanceof Error ? error.message : String(error); + writer.error(`Error: ${message}`); + } + process.exit(1); + } +} + +export const deleteCommand = buildCommand({ + loader: async () => del, + parameters: { + positional: { + kind: "tuple", + parameters: [ + { + brief: "Board (dashboard) ID to delete", + parse: String, + }, + ], + }, + flags: {}, + }, + docs: { + brief: "Delete a board (dashboard) by ID", + }, +}); diff --git a/src/commands/board/get.ts b/src/commands/board/get.ts new file mode 100644 index 0000000..7bd5c86 --- /dev/null +++ b/src/commands/board/get.ts @@ -0,0 +1,53 @@ +import { buildCommand } from "@stricli/core"; +import type { LocalContext } from "../../context"; +import { getBoard } from "../../gql/board/get-board"; +import { GqlApiError } from "../../gql/gql-request"; +import { loadConfig } from "../../lib/config"; + +async function get( + this: LocalContext, + _flags: Record, + id: string, +): Promise { + const { process, writer } = this; + + try { + const config = loadConfig(); + const board = await getBoard(config, id); + + if (board === null) { + writer.error(`Error: board not found: ${id}`); + process.exit(1); + return; + } + + writer.write(JSON.stringify(board, null, 2)); + } catch (error) { + if (error instanceof GqlApiError) { + writer.error(`API Error (${error.statusCode}): ${error.message}`); + } else { + const message = error instanceof Error ? error.message : String(error); + writer.error(`Error: ${message}`); + } + process.exit(1); + } +} + +export const getCommand = buildCommand({ + loader: async () => get, + parameters: { + positional: { + kind: "tuple", + parameters: [ + { + brief: "Board (dashboard) ID", + parse: String, + }, + ], + }, + flags: {}, + }, + docs: { + brief: "Get a board (dashboard) by ID as JSON", + }, +}); diff --git a/src/commands/board/index.ts b/src/commands/board/index.ts new file mode 100644 index 0000000..0cc5840 --- /dev/null +++ b/src/commands/board/index.ts @@ -0,0 +1,38 @@ +import { buildRouteMap } from "@stricli/core"; +import { createCommand } from "./create"; +import { updateCommand } from "./update"; +import { getCommand } from "./get"; +import { listCommand } from "./list"; +import { deleteCommand } from "./delete"; +import { scaffoldCommand } from "./scaffold"; +import { clearDefaultCommand, setDefaultCommand } from "./set-default"; + +export const boardRoutes = buildRouteMap({ + routes: { + create: createCommand, + update: updateCommand, + get: getCommand, + list: listCommand, + delete: deleteCommand, + scaffold: scaffoldCommand, + "set-default": setDefaultCommand, + "clear-default": clearDefaultCommand, + }, + docs: { + brief: "Manage boards (dashboards)", + fullDescription: [ + "Create, update, read, list, delete, and scaffold boards (dashboards),", + "and set or clear the default dashboard for a dataset.", + "", + "Commands:", + " create Create a board from a JSON file", + " update Update an existing board from a JSON file", + " get Get a board by ID as JSON", + " list List boards in a workspace", + " delete Delete a board by ID", + " scaffold Print a minimal board JSON template", + " set-default Set the default dashboard for a dataset", + " clear-default Clear the default dashboard for a dataset", + ].join("\n"), + }, +}); diff --git a/src/commands/board/list.ts b/src/commands/board/list.ts new file mode 100644 index 0000000..349cc21 --- /dev/null +++ b/src/commands/board/list.ts @@ -0,0 +1,124 @@ +import { buildCommand } from "@stricli/core"; +import chalk from "chalk"; +import type { LocalContext } from "../../context"; +import { listBoards, type BoardListEntry } from "../../gql/board/list-boards"; +import { GqlApiError } from "../../gql/gql-request"; +import { loadConfig } from "../../lib/config"; +import { muteStatusWriter } from "../../lib/writer"; +import { + formatTable, + createColumnHelper, + type ColumnDef, +} from "../../lib/formatters/table"; +import { renderAsCSV } from "../../lib/formatters/csv"; + +type OutputFormat = "json" | "csv"; + +interface ListBoardsFlags { + workspace: string; + format?: OutputFormat; + json?: boolean; +} + +const col = createColumnHelper(); + +const columns: ColumnDef[] = [ + col.accessor((row) => row.id, { + header: "ID", + format: (value) => chalk.cyan(value), + }), + col.accessor((row) => row.name, { header: "NAME" }), + col.accessor((row) => row.workspaceId, { + header: "WORKSPACE", + format: (value) => chalk.dim(value), + }), +]; + +async function list( + this: LocalContext, + flags: ListBoardsFlags, + substring?: string, +): Promise { + const format = flags.json ? ("json" as const) : flags.format; + const { process, writer: _writer } = this; + const writer = muteStatusWriter(_writer, { + muted: format === "json" || format === "csv", + }); + + try { + const config = loadConfig(); + + let boards = await listBoards(config, flags.workspace); + if (substring) { + const needle = substring.toLowerCase(); + boards = boards.filter((b) => b.name.toLowerCase().includes(needle)); + } + + if (format === "json") { + writer.write(JSON.stringify(boards, null, 2)); + return; + } + + if (format === "csv") { + writer.write(renderAsCSV(boards)); + return; + } + + if (boards.length === 0) { + writer.warn("No boards found."); + return; + } + + writer.write(chalk.green(`Found ${boards.length} board(s):\n`)); + writer.write(formatTable(boards, columns)); + } catch (error) { + if (error instanceof GqlApiError) { + writer.error(`API Error (${error.statusCode}): ${error.message}`); + } else { + const message = error instanceof Error ? error.message : String(error); + writer.error(`Error: ${message}`); + } + process.exit(1); + } +} + +export const listCommand = buildCommand({ + loader: async () => list, + parameters: { + positional: { + kind: "tuple", + parameters: [ + { + brief: "Filter boards by name substring (optional)", + parse: String, + optional: true, + }, + ], + }, + flags: { + workspace: { + kind: "parsed", + parse: String, + brief: "Workspace ID to list boards in", + optional: false, + }, + format: { + kind: "enum", + values: ["json", "csv"], + brief: "Output format (json, csv)", + optional: true, + }, + json: { + kind: "boolean", + brief: "Output as JSON (shorthand for --format=json)", + optional: true, + }, + }, + aliases: { + w: "workspace", + }, + }, + docs: { + brief: "List boards (dashboards) in a workspace", + }, +}); diff --git a/src/commands/board/read-input.test.ts b/src/commands/board/read-input.test.ts new file mode 100644 index 0000000..a9b0857 --- /dev/null +++ b/src/commands/board/read-input.test.ts @@ -0,0 +1,106 @@ +import { afterEach, describe, expect, test } from "bun:test"; +import * as fs from "node:fs"; +import * as os from "node:os"; +import * as path from "node:path"; +import { readBoardInput } from "./read-input"; + +function writeTempBoard(obj: unknown): string { + const file = path.join( + fs.mkdtempSync(path.join(os.tmpdir(), "board-test-")), + "board.json", + ); + fs.writeFileSync(file, JSON.stringify(obj)); + return file; +} + +const tempFiles: string[] = []; +function temp(obj: unknown): string { + const f = writeTempBoard(obj); + tempFiles.push(f); + return f; +} + +afterEach(() => { + for (const f of tempFiles.splice(0)) { + fs.rmSync(path.dirname(f), { recursive: true, force: true }); + } +}); + +describe("readBoardInput normalization", () => { + test("strips top-level updatedDate", () => { + const input = readBoardInput( + temp({ name: "b", workspaceId: "1", updatedDate: "2026-01-01" }), + ); + expect("updatedDate" in input).toBe(false); + }); + + test("renames stageID to id and drops stageID", () => { + const input = readBoardInput( + temp({ stages: [{ stageID: "s1", pipeline: "limit 1", input: [] }] }), + ); + const stage = (input.stages as Record[])[0]; + expect(stage.id).toBe("s1"); + expect("stageID" in stage).toBe(false); + }); + + test("does not overwrite an existing id when stageID is also present", () => { + const input = readBoardInput( + temp({ stages: [{ id: "keep", stageID: "s1", input: [] }] }), + ); + const stage = (input.stages as Record[])[0]; + expect(stage.id).toBe("keep"); + expect("stageID" in stage).toBe(false); + }); + + test("defaults a missing stage input to []", () => { + const input = readBoardInput( + temp({ stages: [{ stageID: "s1", pipeline: "limit 1" }] }), + ); + const stage = (input.stages as Record[])[0]; + expect(stage.input).toEqual([]); + }); + + test("injects stageId='' and inputRole='Data' on stage input entries", () => { + const input = readBoardInput( + temp({ + stages: [ + { + stageID: "s1", + input: [{ inputName: "main", datasetId: "42" }], + }, + ], + }), + ); + const stage = (input.stages as Record[])[0]; + const entry = (stage.input as Record[])[0]; + expect(entry.stageId).toBe(""); + expect(entry.inputRole).toBe("Data"); + }); + + test("preserves explicit stageId and inputRole on input entries", () => { + const input = readBoardInput( + temp({ + stages: [ + { + stageID: "s1", + input: [ + { inputName: "main", stageId: "other", inputRole: "Reference" }, + ], + }, + ], + }), + ); + const stage = (input.stages as Record[])[0]; + const entry = (stage.input as Record[])[0]; + expect(entry.stageId).toBe("other"); + expect(entry.inputRole).toBe("Reference"); + }); + + test("throws a descriptive error on invalid JSON", () => { + const dir = fs.mkdtempSync(path.join(os.tmpdir(), "board-test-")); + const file = path.join(dir, "bad.json"); + fs.writeFileSync(file, "{ not json"); + tempFiles.push(file); + expect(() => readBoardInput(file)).toThrow(/could not parse JSON/); + }); +}); diff --git a/src/commands/board/read-input.ts b/src/commands/board/read-input.ts new file mode 100644 index 0000000..9636ff8 --- /dev/null +++ b/src/commands/board/read-input.ts @@ -0,0 +1,85 @@ +import * as fs from "node:fs"; + +// Fields returned by the Observe API that are not accepted as input by the +// saveDashboard mutation. +const READ_ONLY_BOARD_FIELDS = ["updatedDate"] as const; + +type BoardInput = Record; + +/** + * Read and normalize a board JSON file for the saveDashboard mutation. + * + * These normalizations are load-bearing bug fixes ported verbatim from + * readBoardInput in the Go fork (cmd_board.go): + * - strip top-level read-only fields (updatedDate) + * - per stage: rename deprecated "stageID" -> "id" (keeps card.stageId + * references valid so panels render); default missing "input" to [] + * - per stage input entry: inject stageId="" and inputRole="Data" when + * absent (both are nullable on write but non-null on read; omitting them + * stores null and makes every later board load fail). + */ +export function readBoardInput(filePath: string): BoardInput { + let data: string; + try { + data = fs.readFileSync(filePath, "utf-8"); + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + throw new Error(`board: could not read file "${filePath}": ${message}`, { + cause: error, + }); + } + + let input: BoardInput; + try { + input = JSON.parse(data) as BoardInput; + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + throw new Error( + `board: could not parse JSON from "${filePath}": ${message}`, + { cause: error }, + ); + } + + for (const field of READ_ONLY_BOARD_FIELDS) { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete input[field]; + } + + const stages = input.stages; + if (Array.isArray(stages)) { + for (const s of stages) { + if (typeof s !== "object" || s === null) continue; + const stage = s as Record; + + // StageQueryInput uses "id" for the user-defined stage label; older board + // JSON uses the deprecated "stageID". Rename so the API honors it. + if ("stageID" in stage) { + if (!("id" in stage)) { + stage.id = stage.stageID; + } + delete stage.stageID; + } + + // DashboardStageInput requires "input" defined; send [] not omitted. + if (!("input" in stage)) { + stage.input = []; + } + + const inputs = stage.input; + if (Array.isArray(inputs)) { + for (const inp of inputs) { + if (typeof inp !== "object" || inp === null) continue; + const entry = inp as Record; + if (!("stageId" in entry)) { + entry.stageId = ""; + } + if (!("inputRole" in entry)) { + entry.inputRole = "Data"; + } + } + } + } + } + + return input; +} diff --git a/src/commands/board/scaffold.ts b/src/commands/board/scaffold.ts new file mode 100644 index 0000000..3caec9f --- /dev/null +++ b/src/commands/board/scaffold.ts @@ -0,0 +1,94 @@ +import { buildCommand } from "@stricli/core"; +import type { LocalContext } from "../../context"; + +// Mirrors boardScaffoldTemplate in the Go fork (cmd_board.go). Prints a minimal +// valid board JSON template; makes no API calls. +function scaffoldTemplate(name: string) { + return { + name, + workspaceId: "YOUR_WORKSPACE_ID", + visibility: "Listed", + layout: { + autoPack: true, + gridLayout: { + sections: [ + { + card: { + title: "Section", + closed: false, + cardType: "section", + }, + items: [ + { + card: { + stageId: "stage-abc123", + cardType: "stage", + }, + layout: { h: 12, w: 12, x: 0, y: 0 }, + }, + ], + }, + ], + }, + stageListLayout: { + timeRange: { + display: "Past 24 hours", + millisFromCurrentTime: 86400000, + timeRangeInfo: { + key: "PRESETS", + name: "Presets", + presetType: "PAST_24_HOURS", + }, + }, + isModified: false, + parameters: [], + }, + }, + stages: [ + { + stageID: "stage-abc123", + pipeline: "limit 100", + input: [ + { + inputName: "main", + datasetId: "YOUR_DATASET_ID", + }, + ], + }, + ], + }; +} + +interface ScaffoldFlags { + name?: string; +} + +async function scaffold( + this: LocalContext, + flags: ScaffoldFlags, +): Promise { + const { writer } = this; + const template = scaffoldTemplate(flags.name ?? "My Dashboard"); + writer.write(JSON.stringify(template, null, 2)); +} + +export const scaffoldCommand = buildCommand({ + loader: async () => scaffold, + parameters: { + positional: { + kind: "tuple", + parameters: [], + }, + flags: { + name: { + kind: "parsed", + parse: String, + brief: "Name to set on the scaffolded board", + optional: true, + }, + }, + }, + docs: { + brief: "Print a minimal board (dashboard) JSON template", + }, +}); diff --git a/src/commands/board/set-default.ts b/src/commands/board/set-default.ts new file mode 100644 index 0000000..58b14e6 --- /dev/null +++ b/src/commands/board/set-default.ts @@ -0,0 +1,99 @@ +import { buildCommand } from "@stricli/core"; +import type { LocalContext } from "../../context"; +import { + clearDefaultDashboard, + setDefaultDashboard, +} from "../../gql/board/default-dashboard"; +import { GqlApiError } from "../../gql/gql-request"; +import { loadConfig } from "../../lib/config"; + +function handleError(this: LocalContext, error: unknown): void { + const { process, writer } = this; + if (error instanceof GqlApiError) { + writer.error(`API Error (${error.statusCode}): ${error.message}`); + } else { + const message = error instanceof Error ? error.message : String(error); + writer.error(`Error: ${message}`); + } + process.exit(1); +} + +async function setDefault( + this: LocalContext, + _flags: Record, + dsid: string, + bid: string, +): Promise { + const { process, writer } = this; + try { + const config = loadConfig(); + const result = await setDefaultDashboard(config, { dsid, dashid: bid }); + // Only treat as failure when `success` is explicitly false; the API may + // populate `errorMessage` with a success notice. + if (result.success === false) { + writer.error( + `Error: board set-default: ${result.errorMessage ?? "failed"}`, + ); + process.exit(1); + return; + } + writer.write("Default dashboard set successfully"); + } catch (error) { + handleError.call(this, error); + } +} + +async function clearDefault( + this: LocalContext, + _flags: Record, + dsid: string, +): Promise { + const { process, writer } = this; + try { + const config = loadConfig(); + const result = await clearDefaultDashboard(config, dsid); + // Only treat as failure when `success` is explicitly false; the API may + // populate `errorMessage` with a success notice. + if (result.success === false) { + writer.error( + `Error: board clear-default: ${result.errorMessage ?? "failed"}`, + ); + process.exit(1); + return; + } + writer.write("Default dashboard cleared successfully"); + } catch (error) { + handleError.call(this, error); + } +} + +export const setDefaultCommand = buildCommand({ + loader: async () => setDefault, + parameters: { + positional: { + kind: "tuple", + parameters: [ + { brief: "Dataset ID", parse: String }, + { brief: "Board (dashboard) ID", parse: String }, + ], + }, + flags: {}, + }, + docs: { + brief: "Set the default dashboard for a dataset", + }, +}); + +export const clearDefaultCommand = buildCommand({ + loader: async () => clearDefault, + parameters: { + positional: { + kind: "tuple", + parameters: [{ brief: "Dataset ID", parse: String }], + }, + flags: {}, + }, + docs: { + brief: "Clear the default dashboard for a dataset", + }, +}); diff --git a/src/commands/board/update.ts b/src/commands/board/update.ts new file mode 100644 index 0000000..89d50ba --- /dev/null +++ b/src/commands/board/update.ts @@ -0,0 +1,59 @@ +import { buildCommand } from "@stricli/core"; +import type { LocalContext } from "../../context"; +import { saveBoard } from "../../gql/board/save-board"; +import { GqlApiError } from "../../gql/gql-request"; +import { loadConfig } from "../../lib/config"; +import { readBoardInput } from "./read-input"; +import { boardViewURL } from "./view-url"; + +async function update( + this: LocalContext, + _flags: Record, + id: string, + file: string, +): Promise { + const { process, writer } = this; + + try { + const config = loadConfig(); + const input = readBoardInput(file); + input.id = id; + + const board = await saveBoard(config, input); + + writer.write(`Updated: ${board.name} (id: ${board.id})`); + writer.write(`Visibility: ${board.visibility ?? ""}`); + writer.write(`View: ${boardViewURL(config, board.workspaceId, board.id)}`); + } catch (error) { + if (error instanceof GqlApiError) { + writer.error(`API Error (${error.statusCode}): ${error.message}`); + } else { + const message = error instanceof Error ? error.message : String(error); + writer.error(`Error: ${message}`); + } + process.exit(1); + } +} + +export const updateCommand = buildCommand({ + loader: async () => update, + parameters: { + positional: { + kind: "tuple", + parameters: [ + { + brief: "Board (dashboard) ID to update", + parse: String, + }, + { + brief: "Path to a board (dashboard) JSON file", + parse: String, + }, + ], + }, + flags: {}, + }, + docs: { + brief: "Update an existing board (dashboard) from a JSON file", + }, +}); diff --git a/src/commands/board/view-url.ts b/src/commands/board/view-url.ts new file mode 100644 index 0000000..9344791 --- /dev/null +++ b/src/commands/board/view-url.ts @@ -0,0 +1,18 @@ +import { getApiBaseUrl, type Config } from "../../lib/config"; + +/** + * Returns the Observe UI URL for viewing a dashboard. Mirrors boardViewURL in + * the Go fork (cmd_board.go). + * + * Pattern: https://{customerId}.{domain}/workspace/{workspaceId}/dashboard/{boardId} + * The UI also accepts a name-slug prefix (e.g. My-Board-43102612) but the bare + * ID works too. + */ +export function boardViewURL( + config: Config, + workspaceId: string, + boardId: string, +): string { + const base = getApiBaseUrl(config); + return `${base}/workspace/${workspaceId}/dashboard/${boardId}`; +} diff --git a/src/commands/folder/create.ts b/src/commands/folder/create.ts new file mode 100644 index 0000000..c6976d8 --- /dev/null +++ b/src/commands/folder/create.ts @@ -0,0 +1,112 @@ +import { buildCommand } from "@stricli/core"; +import type { LocalContext } from "../../context"; +import { + createFolder, + lookupFolderByName, + type Folder, + type FolderInput, +} from "../../gql/folder/folder"; +import { GqlApiError } from "../../gql/gql-request"; +import { loadConfig } from "../../lib/config"; + +interface CreateFolderFlags { + workspace: string; + ensure?: boolean; + description?: string; + iconUrl?: string; +} + +function printFolder( + writer: LocalContext["writer"], + verb: string, + folder: Folder, +): void { + writer.write(`${verb}: ${folder.name} (id: ${folder.id})`); + writer.write(`Workspace: ${folder.workspaceId}`); +} + +async function create( + this: LocalContext, + flags: CreateFolderFlags, + name: string, +): Promise { + const { process, writer } = this; + + try { + const config = loadConfig(); + const workspaceId = flags.workspace; + + // --ensure makes create idempotent: if a folder with this name already + // exists, return it instead of creating a duplicate. + if (flags.ensure) { + const existing = await lookupFolderByName(config, { + workspaceId, + name, + }); + if (existing !== null) { + printFolder(writer, "Exists", existing); + return; + } + } + + const folderConfig: FolderInput = { name }; + if (flags.description) folderConfig.description = flags.description; + if (flags.iconUrl) folderConfig.iconUrl = flags.iconUrl; + + const folder = await createFolder(config, { + workspaceId, + folder: folderConfig, + }); + printFolder(writer, "Created", folder); + } catch (error) { + if (error instanceof GqlApiError) { + writer.error(`API Error (${error.statusCode}): ${error.message}`); + } else { + const message = error instanceof Error ? error.message : String(error); + writer.error(`Error: ${message}`); + } + process.exit(1); + } +} + +export const createCommand = buildCommand({ + loader: async () => create, + parameters: { + positional: { + kind: "tuple", + parameters: [{ brief: "Folder name", parse: String }], + }, + flags: { + workspace: { + kind: "parsed", + parse: String, + brief: "Workspace ID to create the folder in", + optional: false, + }, + ensure: { + kind: "boolean", + brief: + "Return the existing folder if one with this name already exists instead of failing", + optional: true, + }, + description: { + kind: "parsed", + parse: String, + brief: "Folder description", + optional: true, + }, + iconUrl: { + kind: "parsed", + parse: String, + brief: "Folder icon URL", + optional: true, + }, + }, + aliases: { + w: "workspace", + }, + }, + docs: { + brief: "Create a folder (the grouping unit for boards/worksheets)", + }, +}); diff --git a/src/commands/folder/delete.ts b/src/commands/folder/delete.ts new file mode 100644 index 0000000..560e09a --- /dev/null +++ b/src/commands/folder/delete.ts @@ -0,0 +1,51 @@ +import { buildCommand } from "@stricli/core"; +import type { LocalContext } from "../../context"; +import { deleteFolder } from "../../gql/folder/folder"; +import { GqlApiError } from "../../gql/gql-request"; +import { loadConfig } from "../../lib/config"; + +async function del( + this: LocalContext, + _flags: Record, + id: string, +): Promise { + const { process, writer } = this; + + try { + const config = loadConfig(); + const result = await deleteFolder(config, id); + + // The API reports success via `success: true` and may populate + // `errorMessage` with a success notice (e.g. "Deleted folder"), so only + // treat it as a failure when `success` is explicitly false. + if (result.success === false) { + writer.error(`Error: folder delete: ${result.errorMessage ?? "failed"}`); + process.exit(1); + return; + } + + writer.write(`Deleted folder ${id}`); + } catch (error) { + if (error instanceof GqlApiError) { + writer.error(`API Error (${error.statusCode}): ${error.message}`); + } else { + const message = error instanceof Error ? error.message : String(error); + writer.error(`Error: ${message}`); + } + process.exit(1); + } +} + +export const deleteCommand = buildCommand({ + loader: async () => del, + parameters: { + positional: { + kind: "tuple", + parameters: [{ brief: "Folder ID to delete", parse: String }], + }, + flags: {}, + }, + docs: { + brief: "Delete a folder by ID", + }, +}); diff --git a/src/commands/folder/get.ts b/src/commands/folder/get.ts new file mode 100644 index 0000000..6c3af6f --- /dev/null +++ b/src/commands/folder/get.ts @@ -0,0 +1,68 @@ +import { buildCommand } from "@stricli/core"; +import type { LocalContext } from "../../context"; +import { lookupFolderByName } from "../../gql/folder/folder"; +import { GqlApiError } from "../../gql/gql-request"; +import { loadConfig } from "../../lib/config"; + +interface GetFolderFlags { + workspace: string; +} + +async function get( + this: LocalContext, + flags: GetFolderFlags, + name: string, +): Promise { + const { process, writer } = this; + + try { + const config = loadConfig(); + const folder = await lookupFolderByName(config, { + workspaceId: flags.workspace, + name, + }); + + if (folder === null) { + writer.error( + `Error: folder get: no folder named "${name}" in workspace ${flags.workspace}`, + ); + process.exit(1); + return; + } + + writer.write(`Found: ${folder.name} (id: ${folder.id})`); + writer.write(`Workspace: ${folder.workspaceId}`); + } catch (error) { + if (error instanceof GqlApiError) { + writer.error(`API Error (${error.statusCode}): ${error.message}`); + } else { + const message = error instanceof Error ? error.message : String(error); + writer.error(`Error: ${message}`); + } + process.exit(1); + } +} + +export const getCommand = buildCommand({ + loader: async () => get, + parameters: { + positional: { + kind: "tuple", + parameters: [{ brief: "Folder name", parse: String }], + }, + flags: { + workspace: { + kind: "parsed", + parse: String, + brief: "Workspace ID to look up the folder in", + optional: false, + }, + }, + aliases: { + w: "workspace", + }, + }, + docs: { + brief: "Look up a folder by name and print its ID", + }, +}); diff --git a/src/commands/folder/index.ts b/src/commands/folder/index.ts new file mode 100644 index 0000000..3af327c --- /dev/null +++ b/src/commands/folder/index.ts @@ -0,0 +1,27 @@ +import { buildRouteMap } from "@stricli/core"; +import { createCommand } from "./create"; +import { getCommand } from "./get"; +import { updateCommand } from "./update"; +import { deleteCommand } from "./delete"; + +export const folderRoutes = buildRouteMap({ + routes: { + create: createCommand, + get: getCommand, + update: updateCommand, + delete: deleteCommand, + }, + docs: { + brief: "Manage folders (the grouping unit for boards/worksheets)", + fullDescription: [ + "Create, look up, update, or delete folders. A folder groups boards", + "(dashboards) and worksheets within a single workspace.", + "", + "Commands:", + " create Create a folder (use --ensure to make it idempotent)", + " get Look up a folder by name and print its ID", + " update Update a folder's name, description, or icon URL", + " delete Delete a folder by ID", + ].join("\n"), + }, +}); diff --git a/src/commands/folder/update.ts b/src/commands/folder/update.ts new file mode 100644 index 0000000..e0f1263 --- /dev/null +++ b/src/commands/folder/update.ts @@ -0,0 +1,81 @@ +import { buildCommand } from "@stricli/core"; +import type { LocalContext } from "../../context"; +import { updateFolder, type FolderInput } from "../../gql/folder/folder"; +import { GqlApiError } from "../../gql/gql-request"; +import { loadConfig } from "../../lib/config"; + +interface UpdateFolderFlags { + name?: string; + description?: string; + iconUrl?: string; +} + +async function update( + this: LocalContext, + flags: UpdateFolderFlags, + id: string, +): Promise { + const { process, writer } = this; + + try { + const folderConfig: FolderInput = {}; + if (flags.name) folderConfig.name = flags.name; + if (flags.description) folderConfig.description = flags.description; + if (flags.iconUrl) folderConfig.iconUrl = flags.iconUrl; + + if (Object.keys(folderConfig).length === 0) { + writer.error( + "Error: folder update: nothing to change; pass --name, --description, and/or --icon-url", + ); + process.exit(1); + return; + } + + const config = loadConfig(); + const folder = await updateFolder(config, { id, folder: folderConfig }); + + writer.write(`Updated: ${folder.name} (id: ${folder.id})`); + writer.write(`Workspace: ${folder.workspaceId}`); + } catch (error) { + if (error instanceof GqlApiError) { + writer.error(`API Error (${error.statusCode}): ${error.message}`); + } else { + const message = error instanceof Error ? error.message : String(error); + writer.error(`Error: ${message}`); + } + process.exit(1); + } +} + +export const updateCommand = buildCommand({ + loader: async () => update, + parameters: { + positional: { + kind: "tuple", + parameters: [{ brief: "Folder ID to update", parse: String }], + }, + flags: { + name: { + kind: "parsed", + parse: String, + brief: "New folder name", + optional: true, + }, + description: { + kind: "parsed", + parse: String, + brief: "New folder description", + optional: true, + }, + iconUrl: { + kind: "parsed", + parse: String, + brief: "New folder icon URL", + optional: true, + }, + }, + }, + docs: { + brief: "Update a folder's name, description, or icon URL", + }, +}); diff --git a/src/gql/board/default-dashboard.ts b/src/gql/board/default-dashboard.ts new file mode 100644 index 0000000..df890f1 --- /dev/null +++ b/src/gql/board/default-dashboard.ts @@ -0,0 +1,64 @@ +import type { TypedDocumentNode } from "@graphql-typed-document-node/core"; +import { parse } from "graphql"; +import type { Config } from "../../lib/config"; +import { executeGraphQL } from "../gql-request"; + +// Hand-authored GraphQL operations; mirror gqlSetDefaultDashboard and +// gqlClearDefaultDashboard in the Go fork (cmd_board.go). +interface ResultStatus { + success: boolean | null; + errorMessage: string | null; +} + +interface SetDefaultResult { + setDefaultDashboard: ResultStatus; +} + +interface SetDefaultVariables { + dsid: string; + dashid: string; +} + +const SetDefaultDashboardDocument = parse(` + mutation Board_SetDefault($dsid: ObjectId!, $dashid: ObjectId!) { + setDefaultDashboard(dsid: $dsid, dashid: $dashid) { + success + errorMessage + } + } +`) as unknown as TypedDocumentNode; + +interface ClearDefaultResult { + clearDefaultDashboard: ResultStatus; +} + +interface ClearDefaultVariables { + dsid: string; +} + +const ClearDefaultDashboardDocument = parse(` + mutation Board_ClearDefault($dsid: ObjectId!) { + clearDefaultDashboard(dsid: $dsid) { + success + errorMessage + } + } +`) as unknown as TypedDocumentNode; + +export async function setDefaultDashboard( + config: Config, + { dsid, dashid }: { dsid: string; dashid: string }, +) { + const response = await executeGraphQL(config, SetDefaultDashboardDocument, { + dsid, + dashid, + }); + return response.data.setDefaultDashboard; +} + +export async function clearDefaultDashboard(config: Config, dsid: string) { + const response = await executeGraphQL(config, ClearDefaultDashboardDocument, { + dsid, + }); + return response.data.clearDefaultDashboard; +} diff --git a/src/gql/board/delete-board.ts b/src/gql/board/delete-board.ts new file mode 100644 index 0000000..4799c46 --- /dev/null +++ b/src/gql/board/delete-board.ts @@ -0,0 +1,32 @@ +import type { TypedDocumentNode } from "@graphql-typed-document-node/core"; +import { parse } from "graphql"; +import type { Config } from "../../lib/config"; +import { executeGraphQL } from "../gql-request"; + +// Hand-authored GraphQL operation; mirrors gqlDeleteBoard in the Go fork (ot_board.go). +interface ResultStatus { + success: boolean | null; + errorMessage: string | null; +} + +interface DeleteBoardResult { + deleteDashboard: ResultStatus; +} + +interface DeleteBoardVariables { + id: string; +} + +const DeleteBoardDocument = parse(` + mutation Board_Delete($id: ObjectId!) { + deleteDashboard(id: $id) { + success + errorMessage + } + } +`) as unknown as TypedDocumentNode; + +export async function deleteBoard(config: Config, id: string) { + const response = await executeGraphQL(config, DeleteBoardDocument, { id }); + return response.data.deleteDashboard; +} diff --git a/src/gql/board/get-board.ts b/src/gql/board/get-board.ts new file mode 100644 index 0000000..89c7836 --- /dev/null +++ b/src/gql/board/get-board.ts @@ -0,0 +1,70 @@ +import type { TypedDocumentNode } from "@graphql-typed-document-node/core"; +import { parse } from "graphql"; +import type { Config } from "../../lib/config"; +import { executeGraphQL } from "../gql-request"; + +// Hand-authored GraphQL operation; mirrors gqlGetBoard in the Go fork (ot_board.go). +export interface BoardStageInput { + inputName: string | null; + datasetId: string | null; + stageId: string | null; + inputRole: string | null; +} + +export interface BoardStage { + id: string | null; + stageID: string | null; + pipeline: string | null; + input: BoardStageInput[] | null; +} + +export interface Board { + id: string; + name: string; + workspaceId: string; + description: string | null; + folderId: string | null; + visibility: string | null; + updatedDate: string | null; + layout: unknown; + stages: BoardStage[] | null; +} + +interface GetBoardResult { + dashboard: Board | null; +} + +interface GetBoardVariables { + id: string; +} + +const GetBoardDocument = parse(` + query Board_Get($id: ObjectId!) { + dashboard(id: $id) { + id + name + workspaceId + description + folderId + visibility + updatedDate + layout + stages { + id + stageID + pipeline + input { + inputName + datasetId + stageId + inputRole + } + } + } + } +`) as unknown as TypedDocumentNode; + +export async function getBoard(config: Config, id: string) { + const response = await executeGraphQL(config, GetBoardDocument, { id }); + return response.data.dashboard; +} diff --git a/src/gql/board/list-boards.ts b/src/gql/board/list-boards.ts new file mode 100644 index 0000000..16fc0b5 --- /dev/null +++ b/src/gql/board/list-boards.ts @@ -0,0 +1,54 @@ +import type { TypedDocumentNode } from "@graphql-typed-document-node/core"; +import { parse } from "graphql"; +import type { Config } from "../../lib/config"; +import { executeGraphQL } from "../gql-request"; + +// Hand-authored GraphQL operation; mirrors gqlListBoard in the Go fork (ot_board.go). +// NOTE: the workspaceId variable is typed `[ObjectId!]!` (an ARRAY) by the API — +// callers must pass [workspaceId]. +export interface BoardListEntry { + id: string; + name: string; + workspaceId: string; + updatedDate: string | null; +} + +interface BoardSearchItem { + score: number | null; + dashboard: BoardListEntry | null; +} + +interface ListBoardsResult { + dashboardSearch: { + dashboards: BoardSearchItem[]; + }; +} + +interface ListBoardsVariables { + workspaceId: string[]; +} + +const ListBoardsDocument = parse(` + query Board_List($workspaceId: [ObjectId!]!) { + dashboardSearch(terms: { workspaceId: $workspaceId }) { + dashboards { + score + dashboard { + id + name + workspaceId + updatedDate + } + } + } + } +`) as unknown as TypedDocumentNode; + +export async function listBoards(config: Config, workspaceId: string) { + const response = await executeGraphQL(config, ListBoardsDocument, { + workspaceId: [workspaceId], + }); + return response.data.dashboardSearch.dashboards + .map((item) => item.dashboard) + .filter((d): d is BoardListEntry => d !== null); +} diff --git a/src/gql/board/save-board.ts b/src/gql/board/save-board.ts new file mode 100644 index 0000000..235f563 --- /dev/null +++ b/src/gql/board/save-board.ts @@ -0,0 +1,46 @@ +import type { TypedDocumentNode } from "@graphql-typed-document-node/core"; +import { parse } from "graphql"; +import type { Config } from "../../lib/config"; +import { executeGraphQL } from "../gql-request"; + +// Hand-authored GraphQL operation. Codegen is unavailable on this tenant +// (introspection disabled), so the operation document and its types are +// declared by hand. Mirrors gqlSaveBoard in the Go fork (cmd_board.go). +export interface SavedBoard { + id: string; + name: string; + workspaceId: string; + folderId: string | null; + visibility: string | null; +} + +interface SaveBoardResult { + saveDashboard: SavedBoard; +} + +// A board input is an arbitrary dashboard JSON document; the API validates it. +type BoardInput = Record; + +interface SaveBoardVariables { + input: BoardInput; +} + +const SaveBoardDocument = parse(` + mutation Board_Save($input: DashboardInput!) { + saveDashboard(dash: $input) { + id + name + workspaceId + folderId + visibility + } + } +`) as unknown as TypedDocumentNode; + +export async function saveBoard( + config: Config, + input: BoardInput, +): Promise { + const response = await executeGraphQL(config, SaveBoardDocument, { input }); + return response.data.saveDashboard; +} diff --git a/src/gql/folder/folder.ts b/src/gql/folder/folder.ts new file mode 100644 index 0000000..daf5943 --- /dev/null +++ b/src/gql/folder/folder.ts @@ -0,0 +1,164 @@ +import type { TypedDocumentNode } from "@graphql-typed-document-node/core"; +import { parse } from "graphql"; +import { type Config } from "../../lib/config"; +import { executeGraphQL, GqlApiError } from "../gql-request"; + +// Hand-authored GraphQL operations; mirror the queries in the Go fork (cmd_folder.go). +export interface Folder { + id: string; + name: string; + workspaceId: string; + description: string | null; + iconUrl: string | null; +} + +// FolderInput is a partial folder config; name is omitted on update-subset calls. +export interface FolderInput { + name?: string; + description?: string; + iconUrl?: string; +} + +interface CreateFolderResult { + createFolder: Folder; +} + +interface CreateFolderVariables { + workspaceId: string; + config: FolderInput; +} + +const CreateFolderDocument = parse(` + mutation Folder_Create($workspaceId: ObjectId!, $config: FolderInput!) { + createFolder(workspaceId: $workspaceId, folder: $config) { + id + name + workspaceId + description + iconUrl + } + } +`) as unknown as TypedDocumentNode; + +interface UpdateFolderResult { + updateFolder: Folder; +} + +interface UpdateFolderVariables { + id: string; + config: FolderInput; +} + +const UpdateFolderDocument = parse(` + mutation Folder_Update($id: ObjectId!, $config: FolderInput!) { + updateFolder(id: $id, folder: $config) { + id + name + workspaceId + description + iconUrl + } + } +`) as unknown as TypedDocumentNode; + +interface DeleteFolderResult { + deleteFolder: { + success: boolean | null; + errorMessage: string | null; + }; +} + +interface DeleteFolderVariables { + id: string; +} + +const DeleteFolderDocument = parse(` + mutation Folder_Delete($id: ObjectId!) { + deleteFolder(id: $id) { + success + errorMessage + } + } +`) as unknown as TypedDocumentNode; + +interface LookupFolderResult { + workspace: { + folder: Folder | null; + } | null; +} + +interface LookupFolderVariables { + workspaceId: string; + name: string; +} + +const LookupFolderDocument = parse(` + query Folder_Lookup($workspaceId: ObjectId!, $name: String!) { + workspace(id: $workspaceId) { + folder(name: $name) { + id + name + workspaceId + description + iconUrl + } + } + } +`) as unknown as TypedDocumentNode; + +export async function createFolder( + config: Config, + { workspaceId, folder }: { workspaceId: string; folder: FolderInput }, +) { + const response = await executeGraphQL(config, CreateFolderDocument, { + workspaceId, + config: folder, + }); + return response.data.createFolder; +} + +export async function updateFolder( + config: Config, + { id, folder }: { id: string; folder: FolderInput }, +) { + const response = await executeGraphQL(config, UpdateFolderDocument, { + id, + config: folder, + }); + return response.data.updateFolder; +} + +export async function deleteFolder(config: Config, id: string) { + const response = await executeGraphQL(config, DeleteFolderDocument, { id }); + return response.data.deleteFolder; +} + +/** + * Look up a folder by exact name within a workspace. Returns null if none. + * + * When no folder with this name exists, the API returns a GraphQL error (not a + * null result), e.g.: There is no folder named "x" in workspace N. That + * specific case is treated as "not found" (null) so callers — notably + * `create --ensure` — proceed to create rather than failing. Mirrors + * lookupFolderByName in the Go fork (cmd_folder.go). + */ +export async function lookupFolderByName( + config: Config, + { workspaceId, name }: { workspaceId: string; name: string }, +): Promise { + try { + const response = await executeGraphQL(config, LookupFolderDocument, { + workspaceId, + name, + }); + return response.data.workspace?.folder ?? null; + } catch (error) { + if ( + error instanceof GqlApiError && + error.message.includes("no folder named") + ) { + return null; + } + throw error; + } +} diff --git a/src/gql/generated/gql.ts b/src/gql/generated/gql.ts new file mode 100644 index 0000000..7252cea --- /dev/null +++ b/src/gql/generated/gql.ts @@ -0,0 +1,58 @@ +/* eslint-disable */ +import * as types from './graphql'; +import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; + +/** + * Map of all GraphQL operations in the project. + * + * This map has several performance disadvantages: + * 1. It is not tree-shakeable, so it will include all operations in the project. + * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle. + * 3. It does not support dead code elimination, so it will add unused operations. + * + * Therefore it is highly recommended to use the babel or swc plugin for production. + * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size + */ +type Documents = { + "query CheckQueries($queries: MultiStageQueryInput!) {\n checkQueries(queries: $queries) {\n parsedPipeline {\n errors {\n col\n row\n text\n }\n warnings {\n kind\n symbol {\n col\n row\n }\n }\n }\n resultSchema {\n fieldList {\n name\n }\n }\n }\n}": typeof types.CheckQueriesDocument, + "query ValidateIngestFilter($pipeline: String!, $sourceDatasetID: ObjectId!) {\n validateIngestFilterExpression(\n pipeline: $pipeline\n sourceDatasetID: $sourceDatasetID\n ) {\n message\n }\n}": typeof types.ValidateIngestFilterDocument, + "query VerbsAndFunctions {\n verbsAndFunctions {\n verbs {\n name\n description\n categories\n }\n functions {\n name\n description\n categories\n returnType\n }\n }\n}": typeof types.VerbsAndFunctionsDocument, +}; +const documents: Documents = { + "query CheckQueries($queries: MultiStageQueryInput!) {\n checkQueries(queries: $queries) {\n parsedPipeline {\n errors {\n col\n row\n text\n }\n warnings {\n kind\n symbol {\n col\n row\n }\n }\n }\n resultSchema {\n fieldList {\n name\n }\n }\n }\n}": types.CheckQueriesDocument, + "query ValidateIngestFilter($pipeline: String!, $sourceDatasetID: ObjectId!) {\n validateIngestFilterExpression(\n pipeline: $pipeline\n sourceDatasetID: $sourceDatasetID\n ) {\n message\n }\n}": types.ValidateIngestFilterDocument, + "query VerbsAndFunctions {\n verbsAndFunctions {\n verbs {\n name\n description\n categories\n }\n functions {\n name\n description\n categories\n returnType\n }\n }\n}": types.VerbsAndFunctionsDocument, +}; + +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + * + * + * @example + * ```ts + * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`); + * ``` + * + * The query argument is unknown! + * Please regenerate the types. + */ +export function graphql(source: string): unknown; + +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "query CheckQueries($queries: MultiStageQueryInput!) {\n checkQueries(queries: $queries) {\n parsedPipeline {\n errors {\n col\n row\n text\n }\n warnings {\n kind\n symbol {\n col\n row\n }\n }\n }\n resultSchema {\n fieldList {\n name\n }\n }\n }\n}"): (typeof documents)["query CheckQueries($queries: MultiStageQueryInput!) {\n checkQueries(queries: $queries) {\n parsedPipeline {\n errors {\n col\n row\n text\n }\n warnings {\n kind\n symbol {\n col\n row\n }\n }\n }\n resultSchema {\n fieldList {\n name\n }\n }\n }\n}"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "query ValidateIngestFilter($pipeline: String!, $sourceDatasetID: ObjectId!) {\n validateIngestFilterExpression(\n pipeline: $pipeline\n sourceDatasetID: $sourceDatasetID\n ) {\n message\n }\n}"): (typeof documents)["query ValidateIngestFilter($pipeline: String!, $sourceDatasetID: ObjectId!) {\n validateIngestFilterExpression(\n pipeline: $pipeline\n sourceDatasetID: $sourceDatasetID\n ) {\n message\n }\n}"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "query VerbsAndFunctions {\n verbsAndFunctions {\n verbs {\n name\n description\n categories\n }\n functions {\n name\n description\n categories\n returnType\n }\n }\n}"): (typeof documents)["query VerbsAndFunctions {\n verbsAndFunctions {\n verbs {\n name\n description\n categories\n }\n functions {\n name\n description\n categories\n returnType\n }\n }\n}"]; + +export function graphql(source: string) { + return (documents as any)[source] ?? {}; +} + +export type DocumentType> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never; \ No newline at end of file diff --git a/src/gql/generated/graphql.ts b/src/gql/generated/graphql.ts new file mode 100644 index 0000000..ff7890c --- /dev/null +++ b/src/gql/generated/graphql.ts @@ -0,0 +1,269 @@ +/* eslint-disable */ +/** Internal type. DO NOT USE DIRECTLY. */ +type Exact = { [K in keyof T]: T[K] }; +/** Internal type. DO NOT USE DIRECTLY. */ +export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; +import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export const DocumentationCategory = { + Aggregate: 'Aggregate', + Filter: 'Filter', + Join: 'Join', + Metadata: 'Metadata', + Metrics: 'Metrics', + Misc: 'Misc', + Presentation: 'Presentation', + Projection: 'Projection' +} as const; + +export type DocumentationCategory = typeof DocumentationCategory[keyof typeof DocumentationCategory]; +export type InputDefinitionInput = { + /** Datasets defined by IDs refer to latest-published version of dataset. */ + datasetId?: string | null | undefined; + /** Format of datasetPath is projectlabel.datasetlabel */ + datasetPath?: string | null | undefined; + /** Assign the short and unique user mnemonic for this input, used in @tableref expressions */ + inputName: string; + /** If this input is to be used for a purpose other than "slurp data," then specify that here. */ + inputRole?: InputRole | null | undefined; + /** + * If this input is parameterized, this will contain the ID of the parameter to substitute for this input. Parameters + * are bound in the QueryParams for the query being issued with this input. + */ + parameterId?: string | null | undefined; + /** + * Reference a previous query in the worksheet by label + * @deprecated use stageId + */ + stageID?: string | null | undefined; + stageId?: string | null | undefined; +}; + +/** + * Why do we separate "Data" bindings from "Reference" bindings? Why does this + * have to be pre-declared, rather than resolved at the end by the compiler? + * + * Because we have the hard rule that physical dataset IDs only exist in the + * API, not at the OPAL level, we wouldn't know which particular dataset you'd + * suggest to use, unless the input binding was pre-declared. If we just made + * something up in GetTargetDatasetBinding() then how would we later know which + * shape to resolve it to? + * + * The user writes addfk "some name", id=@theThing.id + * + * We need to know what theThing really means. Hence, it needs a binding. Hence, + * when bindings are specified, we need to know whether you expect that to be + * 100% defined, or left pending. We could allow a less concrete pipeline + * specification. Leave @theThing entirely unresolved, and only resolve it using + * some later operation that says "and wherever I called something @theThing, + * now I mean this thing!" (edited) + * + * Which means that we have to live with pipelines that are constantly in + * unresolved and unresolvable states, and only some pipelines can run. We also + * can no longer preview the data until that next step has been taken. + * + * I e, we assume each query (set of stages) compiles and links as a unit. There + * is no separate compilation, because the user experience and complexity of + * that abstraction seems unnecessary just to solve this one use case in this + * one alternative way. + */ +export const InputRole = { + Data: 'Data', + Default: 'Default', + Reference: 'Reference' +} as const; + +export type InputRole = typeof InputRole[keyof typeof InputRole]; +export type MultiStageQueryInput = { + layout?: unknown; + outputStage: string; + parameterValues?: Array | null | undefined; + parameters?: Array | null | undefined; + stages: Array; +}; + +/** + * Parameter values for queries (and defaults) are specified with + * ParameterBindingInput. + * + * For APIs that take a raw StageInput array, the parameterValues argument is in + * parallel. For APIs that take MultiStageQueryInput, parameterValues are part + * of that query. + */ +export type ParameterBindingInput = { + id: string; + value: ValueInput; +}; + +/** + * Whever you can "save" a worksheet-like entity, you can also save the + * parameters that go with it. This is so that the worksheet component in the FE + * can have a unified API to work against. You can also save the parameterValues + * to go with it as well. + */ +export type ParameterSpecInput = { + /** optional default value, must match valueKind if present */ + defaultValue?: ValueInput | null | undefined; + /** opal usable id, ideally a valid C and JavaScript identifier */ + id: string; + /** user-readable name */ + name: string; + valueKind: ValueTypeSpecInput; +}; + +export const PipelineWarningKind = { + /** A deprecated alias of a verb/function is used. */ + AliasDeprecated: 'AliasDeprecated', + /** + * There was a collision with one of the column names, it may have been + * dropped or renamed + */ + ColumnNameCollision: 'ColumnNameCollision', + /** Type is changed with a potential precision loss */ + ColumnPrecisionLoss: 'ColumnPrecisionLoss', + /** A deprecated verb/function specification is used. */ + Deprecated: 'Deprecated', + /** Pipeline acceleration would be expensive. */ + ExpensiveAcceleration: 'ExpensiveAcceleration', + /** Filter is applied to a constant expression */ + FilterOnConstant: 'FilterOnConstant', + /** Generic warning that doesn't require any extra handling by the front end */ + Generic: 'Generic', + /** An internal verb is used */ + Internal: 'Internal', + /** A statement will have no effect */ + NoEffect: 'NoEffect', + /** Pipeline may not be accelerable if published. */ + NotAccelerable: 'NotAccelerable', + /** It is not allowed to publish this pipeline as a dataset view. */ + NotAllowedInView: 'NotAllowedInView', + /** A subquery is unused */ + UnusedSubquery: 'UnusedSubquery' +} as const; + +export type PipelineWarningKind = typeof PipelineWarningKind[keyof typeof PipelineWarningKind]; +export type PrimitiveValueInput = { + bool?: boolean | null | undefined; + duration?: string | null | undefined; + float64?: number | null | undefined; + int64?: string | null | undefined; + string?: string | null | undefined; + timestamp?: unknown; +}; + +export type StageQueryInput = { + /** make id required when we've removed all deprecated use of stageId */ + id?: string | null | undefined; + input: Array; + layout?: unknown; + parameterValues?: Array | null | undefined; + parameters?: Array | null | undefined; + pipeline: string; +}; + +export type ValueArrayInput = { + value: Array; +}; + +/** + * ValueDatasetrefInput looks a bit like InputDefinitionInput, EXCEPT + * you can't specify a parameterId as the value of a ValueDatasetrefInput + * (because that would make little sense.) + */ +export type ValueDatasetrefInput = { + datasetId?: string | null | undefined; + datasetPath?: string | null | undefined; + stageId?: string | null | undefined; +}; + +/** + * The ValueInput specifies a value for a parameter. To specify a null value, specify + * the particular field, but with the JSON value null. This is needed because values + * are always of a particular type, and a generic null is not typed. + */ +export type ValueInput = { + array?: ValueArrayInput | null | undefined; + bool?: boolean | null | undefined; + datasetref?: ValueDatasetrefInput | null | undefined; + duration?: string | null | undefined; + float64?: number | null | undefined; + int64?: string | null | undefined; + link?: ValueLinkInput | null | undefined; + string?: string | null | undefined; + timestamp?: unknown; +}; + +export type ValueKeyValueInput = { + name: string; + value: PrimitiveValueInput; +}; + +export type ValueLinkInput = { + datasetId: string; + primaryKeyValue: Array; + storedLabel?: string | null | undefined; +}; + +/** + * These are the OPAL native types that can go into worksheet parameters. Some + * of the native OPAL types aren't (currently?) exposed to the worksheet + * parameters, but it's likely we will expand this to the full roster over time. + * Also, there will be other places where we send "values" into the API. For + * example, we've dodged it so far in places like monitors, by saying "threshold + * is always float, and facet is always string," but a generic monitor + * specification should absolutely use ValueInput / ValueType. + */ +export const ValueType = { + Array: 'ARRAY', + Bool: 'BOOL', + CorrelationTag: 'CORRELATION_TAG', + Datasetref: 'DATASETREF', + Duration: 'DURATION', + Float64: 'FLOAT64', + Int64: 'INT64', + Link: 'LINK', + /** be explicit about the "empty" value for the null/unknown case */ + None: 'NONE', + String: 'STRING', + Tag: 'TAG', + Timestamp: 'TIMESTAMP' +} as const; + +export type ValueType = typeof ValueType[keyof typeof ValueType]; +export type ValueTypeSpecInput = { + arrayItemType?: ValueTypeSpecInput | null | undefined; + keyForDatasetId?: string | null | undefined; + tagName?: string | null | undefined; + type: ValueType; +}; + +export type CheckQueriesQueryVariables = Exact<{ + queries: MultiStageQueryInput; +}>; + + +export type CheckQueriesQuery = { checkQueries: Array<{ parsedPipeline: { errors: Array<{ col: string, row: string, text: string }> | null, warnings: Array<{ kind: PipelineWarningKind | null, symbol: { col: string, row: string } }> | null }, resultSchema: { fieldList: Array<{ name: string | null }> | null } | null }> }; + +export type ValidateIngestFilterQueryVariables = Exact<{ + pipeline: string; + sourceDatasetID: string; +}>; + + +export type ValidateIngestFilterQuery = { validateIngestFilterExpression: Array< + | { message: string } + | { message: string } + | { message: string } + | { message: string } + | { message: string } + | { message: string } + > | null }; + +export type VerbsAndFunctionsQueryVariables = Exact<{ [key: string]: never; }>; + + +export type VerbsAndFunctionsQuery = { verbsAndFunctions: { verbs: Array<{ name: string, description: string, categories: Array }>, functions: Array<{ name: string, description: string, categories: Array, returnType: string }> } }; + + +export const CheckQueriesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CheckQueries"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"queries"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"MultiStageQueryInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"checkQueries"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"queries"},"value":{"kind":"Variable","name":{"kind":"Name","value":"queries"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"parsedPipeline"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"col"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"text"}}]}},{"kind":"Field","name":{"kind":"Name","value":"warnings"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"symbol"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"col"}},{"kind":"Field","name":{"kind":"Name","value":"row"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"resultSchema"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const ValidateIngestFilterDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ValidateIngestFilter"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pipeline"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sourceDatasetID"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectId"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"validateIngestFilterExpression"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pipeline"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pipeline"}}},{"kind":"Argument","name":{"kind":"Name","value":"sourceDatasetID"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sourceDatasetID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]} as unknown as DocumentNode; +export const VerbsAndFunctionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"VerbsAndFunctions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"verbsAndFunctions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"verbs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"categories"}}]}},{"kind":"Field","name":{"kind":"Name","value":"functions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"categories"}},{"kind":"Field","name":{"kind":"Name","value":"returnType"}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/src/gql/generated/index.ts b/src/gql/generated/index.ts new file mode 100644 index 0000000..af78399 --- /dev/null +++ b/src/gql/generated/index.ts @@ -0,0 +1 @@ +export * from "./gql"; \ No newline at end of file diff --git a/src/kg/search-metrics-kg.ts b/src/kg/search-metrics-kg.ts index ae96ad3..8ddbd17 100644 --- a/src/kg/search-metrics-kg.ts +++ b/src/kg/search-metrics-kg.ts @@ -27,7 +27,9 @@ import { type RelatedEntities, type RelatedMetric, } from "../lib/kg-search"; -import { KGV2DocumentType } from "../rest/generated"; +// TEMP: trimmed pending full Observe schema access (introspection disabled). Restore when schema available. +// import { KGV2DocumentType } from "../rest/generated"; +const KGV2DocumentType = { Metric: "Metric" } as const; import { MetricState } from "../gql/generated/graphql"; import type { GqlMetricMatch } from "../gql/metric/list-metrics"; diff --git a/src/lib/kg-search.ts b/src/lib/kg-search.ts index 6e8f815..88875ab 100644 --- a/src/lib/kg-search.ts +++ b/src/lib/kg-search.ts @@ -6,10 +6,23 @@ * ported here; the CLI does not need the semantic/regex search wrappers. */ -import { ObserveRestSDK } from "../rest/client"; -import { KGV2DocumentType } from "../rest/generated"; +// TEMP: trimmed pending full Observe schema access (introspection disabled). Restore when schema available. +// import { ObserveRestSDK } from "../rest/client"; +// import { KGV2DocumentType } from "../rest/generated"; import type { Config } from "./config"; +// TEMP: the V2 Knowledge Graph REST surface (KGV2DocumentType, V2KnowledgeGraphApi) +// is absent from this tenant's regenerable OpenAPI spec (introspection disabled), +// so the KG-backed lookup helpers below are stubbed to throw. They are only reached +// via dataset/metric list `--correlation-tag-key`, which mop does not use. Restore +// the real implementations (preserved below in comments) when schema is available. +type KGV2DocumentType = string; +function kgUnavailable(): never { + throw new Error( + "Knowledge Graph lookup is unavailable in this build (Observe schema introspection disabled).", + ); +} + /** * KG tag-value document ids strip surrounding quotes and replace dots with * underscores (e.g. `service.name` -> `service_name`). Mirrors the @@ -97,6 +110,14 @@ export async function lookupTagValueRelatedEntities({ key: string; value: string; }): Promise { + // TEMP: trimmed pending full Observe schema access (introspection disabled). Restore when schema available. + void config; + void key; + void value; + void normalizeTagKey; + void extractRelatedEntities; + return kgUnavailable(); + /* Original implementation, restore when KG schema available: const api = new ObserveRestSDK(config).knowledgeGraphApi; // Tag-value doc id format varies by KG indexer version. Some tenants // normalize dots to underscores (matches AI-SRE's kg-shared.ts), others @@ -123,6 +144,7 @@ export async function lookupTagValueRelatedEntities({ relatedDatasetIds: [], relatedMetricIds: [], }; + */ } /** @@ -140,6 +162,12 @@ export async function fetchDocumentsByIds({ ids: string[]; documentType: KGV2DocumentType; }): Promise { + // TEMP: trimmed pending full Observe schema access (introspection disabled). Restore when schema available. + void config; + void ids; + void documentType; + return kgUnavailable(); + /* Original implementation, restore when KG schema available: if (ids.length === 0) return []; const api = new ObserveRestSDK(config).knowledgeGraphApi; try { @@ -151,4 +179,5 @@ export async function fetchDocumentsByIds({ } catch { return []; } + */ } diff --git a/src/rest/client.ts b/src/rest/client.ts index 0a663bc..68c4f89 100644 --- a/src/rest/client.ts +++ b/src/rest/client.ts @@ -1,10 +1,11 @@ import { - SkillsApi, + // TEMP: trimmed pending full Observe schema access (introspection disabled). Restore when schema available. + // SkillsApi, AlertApi, Configuration, DatasetApi, ExportApi, - V2KnowledgeGraphApi, + // V2KnowledgeGraphApi, } from "./generated"; import { getApiBaseUrl, type Config } from "../lib/config"; import { observeApiHeaders } from "../lib/user-agent"; @@ -21,8 +22,9 @@ export class ObserveRestSDK { public exportApi: ExportApi; public datasetApi: DatasetApi; public alertApi: AlertApi; - public knowledgeGraphApi: V2KnowledgeGraphApi; - public skillsApi: SkillsApi; + // TEMP: trimmed pending full Observe schema access (introspection disabled). Restore when schema available. + // public knowledgeGraphApi: V2KnowledgeGraphApi; + // public skillsApi: SkillsApi; constructor(_config: Config) { const config = createConfiguration(_config); @@ -30,7 +32,8 @@ export class ObserveRestSDK { this.exportApi = new ExportApi(config); this.datasetApi = new DatasetApi(config); this.alertApi = new AlertApi(config); - this.knowledgeGraphApi = new V2KnowledgeGraphApi(config); - this.skillsApi = new SkillsApi(config); + // TEMP: trimmed pending full Observe schema access (introspection disabled). Restore when schema available. + // this.knowledgeGraphApi = new V2KnowledgeGraphApi(config); + // this.skillsApi = new SkillsApi(config); } } diff --git a/src/rest/generated/.openapi-generator-ignore b/src/rest/generated/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/src/rest/generated/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/src/rest/generated/.openapi-generator/FILES b/src/rest/generated/.openapi-generator/FILES new file mode 100644 index 0000000..28a665c --- /dev/null +++ b/src/rest/generated/.openapi-generator/FILES @@ -0,0 +1,197 @@ +.openapi-generator-ignore +apis/AlertApi.ts +apis/DatasetApi.ts +apis/DatasetLegacyApi.ts +apis/DatasetQueryFilterApi.ts +apis/DocumentationApi.ts +apis/ExportApi.ts +apis/LoginApi.ts +apis/MonitorApi.ts +apis/MonitorMuteApi.ts +apis/ReferenceTablesApi.ts +apis/ServiceAccountsApi.ts +apis/index.ts +docs/AlertActionStats.md +docs/AlertApi.md +docs/AlertCapturedValue.md +docs/AlertCapturedValueType.md +docs/AlertColumn.md +docs/AlertColumnPath.md +docs/AlertContextEntry.md +docs/AlertCorrelationTag.md +docs/AlertFacetEntry.md +docs/AlertFacets.md +docs/AlertLevel.md +docs/AlertLinkColumn.md +docs/AlertLinkColumnMeta.md +docs/AlertListResponse.md +docs/AlertResolvedServiceBinding.md +docs/AlertResource.md +docs/AlertStatus.md +docs/ApiTokenCreateRequest.md +docs/ApiTokenListResponse.md +docs/ApiTokenResource.md +docs/ApiTokenUpdateRequest.md +docs/DatasetAccelerationError.md +docs/DatasetAccelerationInfo.md +docs/DatasetAccelerationState.md +docs/DatasetAccelerationType.md +docs/DatasetApi.md +docs/DatasetAttributeStats.md +docs/DatasetBrief.md +docs/DatasetCompilationError.md +docs/DatasetContentType.md +docs/DatasetCorrelationTag.md +docs/DatasetDataType.md +docs/DatasetDatasetKind.md +docs/DatasetDefinitionType.md +docs/DatasetFieldDesc.md +docs/DatasetFieldPath.md +docs/DatasetFieldType.md +docs/DatasetForeignKey.md +docs/DatasetGraphResponse.md +docs/DatasetGraphSummary.md +docs/DatasetGroupingElement.md +docs/DatasetGroupingElementType.md +docs/DatasetGroupingKey.md +docs/DatasetImplementedInterface.md +docs/DatasetIndexDefinition.md +docs/DatasetIndexType.md +docs/DatasetInterfaceFieldMapping.md +docs/DatasetLegacyApi.md +docs/DatasetLegacyResource.md +docs/DatasetLegacyResourceConfig.md +docs/DatasetLegacyResourceMeta.md +docs/DatasetLegacyResourceState.md +docs/DatasetLegacyResourceStateColumnsInner.md +docs/DatasetLegacyResourceStateInterfacesInner.md +docs/DatasetListResponse.md +docs/DatasetQueryFilterApi.md +docs/DatasetQueryFilterCreateRequest.md +docs/DatasetQueryFilterResource.md +docs/DatasetQueryFilterUpdateRequest.md +docs/DatasetRef.md +docs/DatasetRelatedKey.md +docs/DatasetResource.md +docs/DatasetStalenessReason.md +docs/DatasetStatValueCount.md +docs/DatasetStatsMeta.md +docs/DatasetStatsResponse.md +docs/DatasetTimeAlignment.md +docs/DocumentationApi.md +docs/DocumentationSearchRequest.md +docs/DocumentationSearchResponse.md +docs/DocumentationSearchResult.md +docs/ErrorMessage.md +docs/ExportApi.md +docs/ExportQueryRequest.md +docs/ExportQueryRequestQuery.md +docs/ExportQueryRequestQueryStagesInner.md +docs/GenerateAPITokenRequest.md +docs/GetDatasetById200Response.md +docs/InputDefinition.md +docs/ListDatasetQueryFilters200Response.md +docs/ListDatasetsResponse.md +docs/LoginApi.md +docs/Meta.md +docs/MonitorApi.md +docs/MonitorBrief.md +docs/MonitorMuteApi.md +docs/MonitorMuteCreateRequest.md +docs/MonitorMuteCronSchedule.md +docs/MonitorMuteListResponse.md +docs/MonitorMuteOneTime.md +docs/MonitorMuteOneTimeInput.md +docs/MonitorMuteRecurring.md +docs/MonitorMuteRecurringInput.md +docs/MonitorMuteResource.md +docs/MonitorMuteSchedule.md +docs/MonitorMuteScheduleInput.md +docs/MonitorMuteScheduleKind.md +docs/MonitorMuteTarget.md +docs/MonitorMuteTargetInput.md +docs/MonitorMuteTargetKind.md +docs/MonitorMuteUpdateRequest.md +docs/MonitorRef.md +docs/MonitorV2.md +docs/MonitorV2ActionDefinition.md +docs/MonitorV2ActionRule.md +docs/MonitorV2ActionType.md +docs/MonitorV2AlarmLevel.md +docs/MonitorV2BooleanOperator.md +docs/MonitorV2Column.md +docs/MonitorV2ColumnComparison.md +docs/MonitorV2ColumnPath.md +docs/MonitorV2Comparison.md +docs/MonitorV2ComparisonExpression.md +docs/MonitorV2ComparisonFunction.md +docs/MonitorV2ComparisonTerm.md +docs/MonitorV2CorrelationTag.md +docs/MonitorV2CountRule.md +docs/MonitorV2CronSchedule.md +docs/MonitorV2CronScheduleAlarmMode.md +docs/MonitorV2Definition.md +docs/MonitorV2EmailAction.md +docs/MonitorV2HttpType.md +docs/MonitorV2LinkColumn.md +docs/MonitorV2LinkColumnMeta.md +docs/MonitorV2MuteRule.md +docs/MonitorV2MuteRuleMonitor.md +docs/MonitorV2MuteRuleSchedule.md +docs/MonitorV2MuteRuleScheduleTerse.md +docs/MonitorV2MuteRuleTerse.md +docs/MonitorV2MuteScheduleType.md +docs/MonitorV2OneTimeMuteSchedule.md +docs/MonitorV2PatchRequest.md +docs/MonitorV2PromoteRule.md +docs/MonitorV2Rule.md +docs/MonitorV2RuleKind.md +docs/MonitorV2Scheduling.md +docs/MonitorV2Terse.md +docs/MonitorV2ThresholdRule.md +docs/MonitorV2TransformSchedule.md +docs/MonitorV2ValueAggregation.md +docs/MonitorV2WebhookAction.md +docs/MonitorV2WebhookHeader.md +docs/MultiStageQuery.md +docs/OAuthExternalIntegrationRef.md +docs/ObjectBrief.md +docs/ObjectRef.md +docs/OpenTimeRange.md +docs/ParameterArrayInner.md +docs/ParameterArrayInnerDefaultValue.md +docs/ParameterArrayInnerValueKind.md +docs/ParameterValueArrayInner.md +docs/PollDelegatedLogin200Response.md +docs/PrimitiveValue.md +docs/PrimitiveValueDatasetref.md +docs/PrimitiveValueLink.md +docs/PrimitiveValueLinkPrimaryKeyValueInner.md +docs/QueryReferenceTables200Response.md +docs/RbacGroupRef.md +docs/ReferenceTablesApi.md +docs/ReferenceTablesTable.md +docs/ReferenceTablesTableMetadata.md +docs/ReferenceTablesTableMetadataPatch.md +docs/ReferenceTablesTableSchemaInner.md +docs/ServiceAccountCreateRequest.md +docs/ServiceAccountExternalOAuth.md +docs/ServiceAccountListResponse.md +docs/ServiceAccountResource.md +docs/ServiceAccountUpdateRequest.md +docs/ServiceAccountsApi.md +docs/StagePresentationInput.md +docs/StagePresentationInputOrderColumnsInner.md +docs/StageQuery.md +docs/StartDelegatedLogin200Response.md +docs/StartDelegatedLogin400Response.md +docs/StartDelegatedLoginRequest.md +docs/StorageIntegrationBrief.md +docs/StorageIntegrationRef.md +docs/StorageIntegrationStorageProvider.md +docs/StorageIntegrationType.md +docs/UpdateReferenceTable200Response.md +docs/User.md +index.ts +models/index.ts +runtime.ts diff --git a/src/rest/generated/.openapi-generator/VERSION b/src/rest/generated/.openapi-generator/VERSION new file mode 100644 index 0000000..3821090 --- /dev/null +++ b/src/rest/generated/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.19.0 diff --git a/src/rest/generated/apis/AlertApi.ts b/src/rest/generated/apis/AlertApi.ts new file mode 100644 index 0000000..5542b8b --- /dev/null +++ b/src/rest/generated/apis/AlertApi.ts @@ -0,0 +1,171 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Observe API + * # Overview Welcome to the Observe API Docs! The Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded. ## Authentication Requests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication: ``` // passing token as bearer token curl -H \"Authorization: Bearer \" https://..com/v1/... ``` + * + * The version of the OpenAPI document: 1.0.230307 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AlertListResponse, + AlertResource, + ErrorMessage, +} from '../models/index'; + +export interface AlertApiGetAlertRequest { + id: string; + expand?: boolean; +} + +export interface AlertApiListAlertsRequest { + filter?: string; + orderBy?: string; + startTime?: string; + endTime?: string; + activeAt?: string; + offset?: number; + limit?: number; + expand?: boolean; + includeFacets?: boolean; +} + +/** + * + */ +export class AlertApi extends runtime.BaseAPI { + + /** + * Get a single alert by its unique id. Unlike the list endpoint, this lookup is not time-windowed: it returns the alert regardless of how long ago it fired. Returns 404 if no alert with the given id exists in the workspace or if the caller lacks view permission on the alert\'s monitor. + * Get an alert by id + */ + async getAlertRaw(requestParameters: AlertApiGetAlertRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getAlert().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/alerts/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Get a single alert by its unique id. Unlike the list endpoint, this lookup is not time-windowed: it returns the alert regardless of how long ago it fired. Returns 404 if no alert with the given id exists in the workspace or if the caller lacks view permission on the alert\'s monitor. + * Get an alert by id + */ + async getAlert(requestParameters: AlertApiGetAlertRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getAlertRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List monitor alerts, optionally filtering and sorting the response. Filters are specified in the [CEL query language](https://cel.dev). Supported orderBy fields: id, level, status, start, monitor.id, monitor.label. Time scoping can be provided in two ways (mutually exclusive): - startTime/endTime: a time range. Alerts overlapping this range are returned. Defaults to the last 24 hours. - activeAt: a single timestamp. Returns alerts that were active at that moment. If both activeAt and startTime/endTime are provided, returns 400. Default page size is 200, maximum is 1000. + * List alerts + */ + async listAlertsRaw(requestParameters: AlertApiListAlertsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters['filter'] != null) { + queryParameters['filter'] = requestParameters['filter']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + if (requestParameters['startTime'] != null) { + queryParameters['startTime'] = requestParameters['startTime']; + } + + if (requestParameters['endTime'] != null) { + queryParameters['endTime'] = requestParameters['endTime']; + } + + if (requestParameters['activeAt'] != null) { + queryParameters['activeAt'] = requestParameters['activeAt']; + } + + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + if (requestParameters['includeFacets'] != null) { + queryParameters['includeFacets'] = requestParameters['includeFacets']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/alerts`; + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * List monitor alerts, optionally filtering and sorting the response. Filters are specified in the [CEL query language](https://cel.dev). Supported orderBy fields: id, level, status, start, monitor.id, monitor.label. Time scoping can be provided in two ways (mutually exclusive): - startTime/endTime: a time range. Alerts overlapping this range are returned. Defaults to the last 24 hours. - activeAt: a single timestamp. Returns alerts that were active at that moment. If both activeAt and startTime/endTime are provided, returns 400. Default page size is 200, maximum is 1000. + * List alerts + */ + async listAlerts(requestParameters: AlertApiListAlertsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAlertsRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/rest/generated/apis/DatasetApi.ts b/src/rest/generated/apis/DatasetApi.ts new file mode 100644 index 0000000..a0695f1 --- /dev/null +++ b/src/rest/generated/apis/DatasetApi.ts @@ -0,0 +1,327 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Observe API + * # Overview Welcome to the Observe API Docs! The Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded. ## Authentication Requests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication: ``` // passing token as bearer token curl -H \"Authorization: Bearer \" https://..com/v1/... ``` + * + * The version of the OpenAPI document: 1.0.230307 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + DatasetGraphResponse, + DatasetListResponse, + DatasetResource, + DatasetStatsResponse, + ErrorMessage, +} from '../models/index'; + +export interface DatasetApiGetDatasetRequest { + id: string; + expand?: boolean; +} + +export interface DatasetApiGetDatasetGraphRequest { + id: string; + limit?: number; +} + +export interface DatasetApiGetDatasetStatsRequest { + topK: number; + filter?: string; + attributes?: string; + multiValueAttributes?: string; +} + +export interface DatasetApiListDatasetsRequest { + filter?: string; + orderBy?: string; + offset?: number; + limit?: number; + expand?: boolean; + query?: string; + minScore?: number; +} + +/** + * + */ +export class DatasetApi extends runtime.BaseAPI { + + /** + * > **Alpha:** This API may change without notice; not recommended > for production use. Returns a single dataset by ID. The response body is the same `Dataset-Resource` shape returned by the list endpoint. Set `expand=true` to inline reference fields (`createdBy`, `updatedBy`, `managedBy`, `defaultDashboard`, `defaultInstanceDashboard`, `storageIntegration.record`). Without `expand`, references contain only `id`. To look up a dataset by label or other attribute, use `GET /v1/datasets` with a CEL `filter`. + * Get a dataset + */ + async getDatasetRaw(requestParameters: DatasetApiGetDatasetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getDataset().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/datasets/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * > **Alpha:** This API may change without notice; not recommended > for production use. Returns a single dataset by ID. The response body is the same `Dataset-Resource` shape returned by the list endpoint. Set `expand=true` to inline reference fields (`createdBy`, `updatedBy`, `managedBy`, `defaultDashboard`, `defaultInstanceDashboard`, `storageIntegration.record`). Without `expand`, references contain only `id`. To look up a dataset by label or other attribute, use `GET /v1/datasets` with a CEL `filter`. + * Get a dataset + */ + async getDataset(requestParameters: DatasetApiGetDatasetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getDatasetRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * > **Alpha:** This API may change without notice; not recommended > for production use. Returns the BFS-nearest lineage neighborhood around the focal dataset id, walking transform data-input edges (`InputRole=Data`) in both directions over the default-filtered dataset set (excludes monitors and metric SMA datasets). The response uses the same `Dataset-GraphResponse` shape as `GET /v1/datasets/graph`. Lineage view semantics: foreign-key edges are **not** traversed by this endpoint — they are surfaced by the full-graph endpoint for the Link/Explore-Universe views. Reference-role transform inputs are also excluded. Ordering within the response is BFS order: focal dataset first, then by BFS depth, ties broken by `id` ascending. If the walk exceeds `limit`, the response is truncated to the nearest `limit` nodes and `meta.totalCount` is set to `-1`. CEL `filter` and `expand` are not supported. + * Get the lineage graph neighborhood around a focal dataset + */ + async getDatasetGraphRaw(requestParameters: DatasetApiGetDatasetGraphRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getDatasetGraph().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/datasets/{id}/graph`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * > **Alpha:** This API may change without notice; not recommended > for production use. Returns the BFS-nearest lineage neighborhood around the focal dataset id, walking transform data-input edges (`InputRole=Data`) in both directions over the default-filtered dataset set (excludes monitors and metric SMA datasets). The response uses the same `Dataset-GraphResponse` shape as `GET /v1/datasets/graph`. Lineage view semantics: foreign-key edges are **not** traversed by this endpoint — they are surfaced by the full-graph endpoint for the Link/Explore-Universe views. Reference-role transform inputs are also excluded. Ordering within the response is BFS order: focal dataset first, then by BFS depth, ties broken by `id` ascending. If the walk exceeds `limit`, the response is truncated to the nearest `limit` nodes and `meta.totalCount` is set to `-1`. CEL `filter` and `expand` are not supported. + * Get the lineage graph neighborhood around a focal dataset + */ + async getDatasetGraph(requestParameters: DatasetApiGetDatasetGraphRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getDatasetGraphRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * > **Alpha:** This API may change without notice; not recommended > for production use. Returns aggregated statistics — distinct value count and the top-K most frequent value/count pairs — for one or more dataset attributes, optionally restricted to a CEL-filtered subset of datasets. Each `attributes` entry is a CEL expression that produces a comparable value (string, int, bool, timestamp); compound expressions are allowed (`coalesce(_package, label)`). The CEL environment matches `GET /v1/datasets`; see that endpoint\'s description for the field mapping, type discrepancies, and available functions. Each `multiValueAttributes` entry is a CEL expression that produces a `list`; the list is flattened across all matching datasets and counted as **total occurrences**, so a single dataset whose expression evaluates to a 3-element list contributes 3 increments. `multiValueAttributes` `count` values may therefore exceed `meta.filteredDatasets`. For `attributes` the count is unchanged: the number of *datasets* with that value. At least one of `attributes` or `multiValueAttributes` must be non-empty; passing neither returns 400. Stat values are returned as JSON strings regardless of the expression\'s CEL type: - `string` — verbatim. - `int` — decimal digits (e.g. `\"41000234\"`). - `bool` — `\"true\"` or `\"false\"`. - `timestamp` — RFC 3339 (e.g. `\"2024-01-01T00:00:00Z\"`). The response `meta` block reports `totalDatasets` (before the filter) and `filteredDatasets` (after) so callers can compute coverage. + * Get dataset attribute statistics + */ + async getDatasetStatsRaw(requestParameters: DatasetApiGetDatasetStatsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['topK'] == null) { + throw new runtime.RequiredError( + 'topK', + 'Required parameter "topK" was null or undefined when calling getDatasetStats().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['filter'] != null) { + queryParameters['filter'] = requestParameters['filter']; + } + + if (requestParameters['attributes'] != null) { + queryParameters['attributes'] = requestParameters['attributes']; + } + + if (requestParameters['multiValueAttributes'] != null) { + queryParameters['multiValueAttributes'] = requestParameters['multiValueAttributes']; + } + + if (requestParameters['topK'] != null) { + queryParameters['topK'] = requestParameters['topK']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/datasets/stats`; + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * > **Alpha:** This API may change without notice; not recommended > for production use. Returns aggregated statistics — distinct value count and the top-K most frequent value/count pairs — for one or more dataset attributes, optionally restricted to a CEL-filtered subset of datasets. Each `attributes` entry is a CEL expression that produces a comparable value (string, int, bool, timestamp); compound expressions are allowed (`coalesce(_package, label)`). The CEL environment matches `GET /v1/datasets`; see that endpoint\'s description for the field mapping, type discrepancies, and available functions. Each `multiValueAttributes` entry is a CEL expression that produces a `list`; the list is flattened across all matching datasets and counted as **total occurrences**, so a single dataset whose expression evaluates to a 3-element list contributes 3 increments. `multiValueAttributes` `count` values may therefore exceed `meta.filteredDatasets`. For `attributes` the count is unchanged: the number of *datasets* with that value. At least one of `attributes` or `multiValueAttributes` must be non-empty; passing neither returns 400. Stat values are returned as JSON strings regardless of the expression\'s CEL type: - `string` — verbatim. - `int` — decimal digits (e.g. `\"41000234\"`). - `bool` — `\"true\"` or `\"false\"`. - `timestamp` — RFC 3339 (e.g. `\"2024-01-01T00:00:00Z\"`). The response `meta` block reports `totalDatasets` (before the filter) and `filteredDatasets` (after) so callers can compute coverage. + * Get dataset attribute statistics + */ + async getDatasetStats(requestParameters: DatasetApiGetDatasetStatsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getDatasetStatsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * > **Alpha:** This API may change without notice; not recommended > for production use. Returns a lean per-dataset projection — `Dataset-GraphSummary` — for every dataset visible in the environment, plus the foreign-key and transform-input edges between them. Sorted by `id` ascending. Designed to feed the Explore Universe graph in a single call. Intentionally unpaginated and intentionally unfiltered: this endpoint applies a fixed default filter that excludes monitors (`isMonitor`) and metric SMA datasets (`isMetricSMA`), and does not accept a CEL `filter` or `expand`. Always returns 200 with `meta.totalCount` equal to the number of returned datasets; the `-1` sentinel is not used here. Callers that need to defend against very large environments should cap on the client side. For arbitrary filtering or pagination, use `GET /v1/datasets` instead. For the lineage neighborhood around a single dataset, use `GET /v1/datasets/{id}/graph`. + * Get the full dataset graph + */ + async listDatasetGraphRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/datasets/graph`; + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * > **Alpha:** This API may change without notice; not recommended > for production use. Returns a lean per-dataset projection — `Dataset-GraphSummary` — for every dataset visible in the environment, plus the foreign-key and transform-input edges between them. Sorted by `id` ascending. Designed to feed the Explore Universe graph in a single call. Intentionally unpaginated and intentionally unfiltered: this endpoint applies a fixed default filter that excludes monitors (`isMonitor`) and metric SMA datasets (`isMetricSMA`), and does not accept a CEL `filter` or `expand`. Always returns 200 with `meta.totalCount` equal to the number of returned datasets; the `-1` sentinel is not used here. Callers that need to defend against very large environments should cap on the client side. For arbitrary filtering or pagination, use `GET /v1/datasets` instead. For the lineage neighborhood around a single dataset, use `GET /v1/datasets/{id}/graph`. + * Get the full dataset graph + */ + async listDatasetGraph(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listDatasetGraphRaw(initOverrides); + return await response.value(); + } + + /** + * > **Alpha:** This API may change without notice; not recommended > for production use. Returns a paginated list of datasets the caller has read access to, optionally filtered and ordered with a CEL expression. Default page size is 50; maximum is 100. Default ordering is by `id` ascending. Set `expand=true` to inline reference fields (`createdBy`, `managedBy`, `storageIntegration.record`, …). Without `expand`, references contain only `id`. ## Filtering and ordering with CEL The `filter` and `orderBy` query parameters are evaluated as [Common Expression Language (CEL)](https://cel.dev) expressions against a stable schema that mirrors the dataset response body. `filter` must evaluate to `bool`; `orderBy` is a CSV list of CEL expressions whose values must be comparable. URL-encode both; CSV-escape `orderBy` items first (see the `orderBy` parameter for syntax). Expressions that reference unknown fields, use the wrong type, or exceed the server-side cost limit return 400. ### CEL → REST field mapping With the exceptions noted below, every CEL field name matches the JSON key on `Dataset-Resource` 1‑to‑1, and CEL types map to JSON wire types as follows: | CEL type | JSON wire type | | ------------------- | ------------------------------------------------ | | `string`, `string?` | string (or `null` when nullable) | | `bool` | boolean | | `int` | integer | | `timestamp` | RFC 3339 string (e.g. `createdAt`, `updatedAt`) | | `list(T)` | array | | `map(K, V)` | object | | Wrapper types | nested object with the same sub-field names | Every `id` field — top-level and nested — is `int` in CEL but rendered as `string` in JSON (int64 values may overflow the JS number range). Compare with an integer literal in CEL: `id == 41000234`, not `id == \"41000234\"`. ### Discrepancies between CEL and REST | Field | CEL | REST | Notes | | ------------------------------ | ---------------------------------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | `_name`, `_package` | `string`, derived from `label` | not present | CEL-only convenience fields. `label = \"Logs/AWS/CloudTrail\"` ⇒ `_package = \"Logs/AWS/\"`, `_name = \"CloudTrail\"`. | | `createdAt`, `updatedAt` | `timestamp` | RFC 3339 string | In CEL, compare with `timestamp(\"2024-01-01T00:00:00Z\")` or use `now() - duration(\"24h\")`. | | `storageIntegration.record.*` | always loadable for filter evaluation | only present when `expand=true` | A filter like `storageIntegration.record.label == \"snowflake-prod\"` works on every request; the `record` object is only echoed back in the response when `expand=true`. | ### Available CEL functions The dataset CEL environment registers the [CEL standard definitions](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/cel#StdLib) (operators, `in`, `?:`, `size()`, `string.contains`, `string.startsWith`, `string.endsWith`, `matches`, etc.) plus the following extension libraries from [cel-go v0.28.0](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext): - [`ext.Strings`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Strings) — `charAt`, `indexOf`, `join`, `lowerAscii`, `replace`, `split`, `substring`, `trim`, `upperAscii`, `format` - [`ext.Lists`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Lists) — `lists.flatten`, `lists.range`, `lists.slice` - [`ext.Math`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Math) — `math.greatest`, `math.least` - [`ext.Sets`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Sets) — `sets.contains`, `sets.equivalent`, `sets.intersects` - [`ext.Regex`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Regex) — `re.capture`, `re.extract` - [`ext.Encoders`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Encoders) — `base64.encode`, `base64.decode` - [`ext.Bindings`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Bindings) — `cel.bind` for let-binding sub-expressions - [`ext.Protos`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Protos) — protobuf helpers - [`cel.OptionalTypes`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/cel#OptionalTypes) — `optional.of`, `optional.ofNonZero`, `optional.none` See `Dataset-Resource` below for the full set of fields and types. ## Semantic search Pass `query` to find datasets by meaning rather than by exact field values. Results are ranked by relevance descending; `orderBy` is ignored when `query` is set. `meta.totalCount` is always `-1` for semantic-search requests because the full match count cannot be computed efficiently. `filter` may be combined with `query` to narrow results after ranking. When both are set, the response may contain fewer than `limit` items if many ranked candidates are filtered out. Returns 404 if semantic search is not available in this deployment. + * Get a list of datasets + */ + async listDatasetsRaw(requestParameters: DatasetApiListDatasetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters['filter'] != null) { + queryParameters['filter'] = requestParameters['filter']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['minScore'] != null) { + queryParameters['minScore'] = requestParameters['minScore']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/datasets`; + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * > **Alpha:** This API may change without notice; not recommended > for production use. Returns a paginated list of datasets the caller has read access to, optionally filtered and ordered with a CEL expression. Default page size is 50; maximum is 100. Default ordering is by `id` ascending. Set `expand=true` to inline reference fields (`createdBy`, `managedBy`, `storageIntegration.record`, …). Without `expand`, references contain only `id`. ## Filtering and ordering with CEL The `filter` and `orderBy` query parameters are evaluated as [Common Expression Language (CEL)](https://cel.dev) expressions against a stable schema that mirrors the dataset response body. `filter` must evaluate to `bool`; `orderBy` is a CSV list of CEL expressions whose values must be comparable. URL-encode both; CSV-escape `orderBy` items first (see the `orderBy` parameter for syntax). Expressions that reference unknown fields, use the wrong type, or exceed the server-side cost limit return 400. ### CEL → REST field mapping With the exceptions noted below, every CEL field name matches the JSON key on `Dataset-Resource` 1‑to‑1, and CEL types map to JSON wire types as follows: | CEL type | JSON wire type | | ------------------- | ------------------------------------------------ | | `string`, `string?` | string (or `null` when nullable) | | `bool` | boolean | | `int` | integer | | `timestamp` | RFC 3339 string (e.g. `createdAt`, `updatedAt`) | | `list(T)` | array | | `map(K, V)` | object | | Wrapper types | nested object with the same sub-field names | Every `id` field — top-level and nested — is `int` in CEL but rendered as `string` in JSON (int64 values may overflow the JS number range). Compare with an integer literal in CEL: `id == 41000234`, not `id == \"41000234\"`. ### Discrepancies between CEL and REST | Field | CEL | REST | Notes | | ------------------------------ | ---------------------------------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | `_name`, `_package` | `string`, derived from `label` | not present | CEL-only convenience fields. `label = \"Logs/AWS/CloudTrail\"` ⇒ `_package = \"Logs/AWS/\"`, `_name = \"CloudTrail\"`. | | `createdAt`, `updatedAt` | `timestamp` | RFC 3339 string | In CEL, compare with `timestamp(\"2024-01-01T00:00:00Z\")` or use `now() - duration(\"24h\")`. | | `storageIntegration.record.*` | always loadable for filter evaluation | only present when `expand=true` | A filter like `storageIntegration.record.label == \"snowflake-prod\"` works on every request; the `record` object is only echoed back in the response when `expand=true`. | ### Available CEL functions The dataset CEL environment registers the [CEL standard definitions](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/cel#StdLib) (operators, `in`, `?:`, `size()`, `string.contains`, `string.startsWith`, `string.endsWith`, `matches`, etc.) plus the following extension libraries from [cel-go v0.28.0](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext): - [`ext.Strings`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Strings) — `charAt`, `indexOf`, `join`, `lowerAscii`, `replace`, `split`, `substring`, `trim`, `upperAscii`, `format` - [`ext.Lists`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Lists) — `lists.flatten`, `lists.range`, `lists.slice` - [`ext.Math`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Math) — `math.greatest`, `math.least` - [`ext.Sets`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Sets) — `sets.contains`, `sets.equivalent`, `sets.intersects` - [`ext.Regex`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Regex) — `re.capture`, `re.extract` - [`ext.Encoders`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Encoders) — `base64.encode`, `base64.decode` - [`ext.Bindings`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Bindings) — `cel.bind` for let-binding sub-expressions - [`ext.Protos`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Protos) — protobuf helpers - [`cel.OptionalTypes`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/cel#OptionalTypes) — `optional.of`, `optional.ofNonZero`, `optional.none` See `Dataset-Resource` below for the full set of fields and types. ## Semantic search Pass `query` to find datasets by meaning rather than by exact field values. Results are ranked by relevance descending; `orderBy` is ignored when `query` is set. `meta.totalCount` is always `-1` for semantic-search requests because the full match count cannot be computed efficiently. `filter` may be combined with `query` to narrow results after ranking. When both are set, the response may contain fewer than `limit` items if many ranked candidates are filtered out. Returns 404 if semantic search is not available in this deployment. + * Get a list of datasets + */ + async listDatasets(requestParameters: DatasetApiListDatasetsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listDatasetsRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/rest/generated/apis/DatasetLegacyApi.ts b/src/rest/generated/apis/DatasetLegacyApi.ts new file mode 100644 index 0000000..0a32ae3 --- /dev/null +++ b/src/rest/generated/apis/DatasetLegacyApi.ts @@ -0,0 +1,145 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Observe API + * # Overview Welcome to the Observe API Docs! The Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded. ## Authentication Requests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication: ``` // passing token as bearer token curl -H \"Authorization: Bearer \" https://..com/v1/... ``` + * + * The version of the OpenAPI document: 1.0.230307 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + GetDatasetById200Response, + ListDatasetsResponse, +} from '../models/index'; + +export interface DatasetLegacyApiGetDatasetByIdRequest { + id: string; +} + +export interface DatasetLegacyApiListDatasetsRequest { + workspaceId?: number; + match?: string; + name?: string; + type?: string; + _interface?: string; +} + +/** + * + */ +export class DatasetLegacyApi extends runtime.BaseAPI { + + /** + * Get information about one dataset by id. Does not query the data inside the dataset. + * Get a dataset (legacy) + */ + async getDatasetByIdRaw(requestParameters: DatasetLegacyApiGetDatasetByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getDatasetById().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/dataset/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Get information about one dataset by id. Does not query the data inside the dataset. + * Get a dataset (legacy) + */ + async getDatasetById(requestParameters: DatasetLegacyApiGetDatasetByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getDatasetByIdRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List datasets, optionally matching: * Name substring * Workspace ID * Dataset type * Interface binding + * List datasets (legacy) + */ + async listDatasetsRaw(requestParameters: DatasetLegacyApiListDatasetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters['workspaceId'] != null) { + queryParameters['workspaceId'] = requestParameters['workspaceId']; + } + + if (requestParameters['match'] != null) { + queryParameters['match'] = requestParameters['match']; + } + + if (requestParameters['name'] != null) { + queryParameters['name'] = requestParameters['name']; + } + + if (requestParameters['type'] != null) { + queryParameters['type'] = requestParameters['type']; + } + + if (requestParameters['_interface'] != null) { + queryParameters['interface'] = requestParameters['_interface']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/dataset`; + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * List datasets, optionally matching: * Name substring * Workspace ID * Dataset type * Interface binding + * List datasets (legacy) + */ + async listDatasets(requestParameters: DatasetLegacyApiListDatasetsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listDatasetsRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/rest/generated/apis/DatasetQueryFilterApi.ts b/src/rest/generated/apis/DatasetQueryFilterApi.ts new file mode 100644 index 0000000..98a8948 --- /dev/null +++ b/src/rest/generated/apis/DatasetQueryFilterApi.ts @@ -0,0 +1,363 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Observe API + * # Overview Welcome to the Observe API Docs! The Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded. ## Authentication Requests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication: ``` // passing token as bearer token curl -H \"Authorization: Bearer \" https://..com/v1/... ``` + * + * The version of the OpenAPI document: 1.0.230307 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + DatasetQueryFilterCreateRequest, + DatasetQueryFilterResource, + DatasetQueryFilterUpdateRequest, + ErrorMessage, + ListDatasetQueryFilters200Response, +} from '../models/index'; + +export interface DatasetQueryFilterApiCreateDatasetQueryFilterRequest { + datasetId: string; + datasetQueryFilterCreateRequest: DatasetQueryFilterCreateRequest; + expand?: boolean; +} + +export interface DatasetQueryFilterApiDeleteDatasetQueryFilterRequest { + datasetId: string; + id: string; +} + +export interface DatasetQueryFilterApiGetDatasetQueryFilterByIdRequest { + datasetId: string; + id: string; + expand?: boolean; +} + +export interface DatasetQueryFilterApiListDatasetQueryFiltersRequest { + datasetId: string; + limit?: number; + offset?: number; + expand?: boolean; +} + +export interface DatasetQueryFilterApiUpdateDatasetQueryFilterRequest { + datasetId: string; + id: string; + datasetQueryFilterUpdateRequest: DatasetQueryFilterUpdateRequest; + expand?: boolean; +} + +/** + * + */ +export class DatasetQueryFilterApi extends runtime.BaseAPI { + + /** + * Create a new query filter for a specific dataset + * Create a new dataset query filter + */ + async createDatasetQueryFilterRaw(requestParameters: DatasetQueryFilterApiCreateDatasetQueryFilterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['datasetId'] == null) { + throw new runtime.RequiredError( + 'datasetId', + 'Required parameter "datasetId" was null or undefined when calling createDatasetQueryFilter().' + ); + } + + if (requestParameters['datasetQueryFilterCreateRequest'] == null) { + throw new runtime.RequiredError( + 'datasetQueryFilterCreateRequest', + 'Required parameter "datasetQueryFilterCreateRequest" was null or undefined when calling createDatasetQueryFilter().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/datasets/{datasetId}/query-filters`; + urlPath = urlPath.replace(`{${"datasetId"}}`, encodeURIComponent(String(requestParameters['datasetId']))); + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['datasetQueryFilterCreateRequest'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Create a new query filter for a specific dataset + * Create a new dataset query filter + */ + async createDatasetQueryFilter(requestParameters: DatasetQueryFilterApiCreateDatasetQueryFilterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createDatasetQueryFilterRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete an existing query filter + * Delete a dataset query filter + */ + async deleteDatasetQueryFilterRaw(requestParameters: DatasetQueryFilterApiDeleteDatasetQueryFilterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['datasetId'] == null) { + throw new runtime.RequiredError( + 'datasetId', + 'Required parameter "datasetId" was null or undefined when calling deleteDatasetQueryFilter().' + ); + } + + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling deleteDatasetQueryFilter().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/datasets/{datasetId}/query-filters/{id}`; + urlPath = urlPath.replace(`{${"datasetId"}}`, encodeURIComponent(String(requestParameters['datasetId']))); + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete an existing query filter + * Delete a dataset query filter + */ + async deleteDatasetQueryFilter(requestParameters: DatasetQueryFilterApiDeleteDatasetQueryFilterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteDatasetQueryFilterRaw(requestParameters, initOverrides); + } + + /** + * Retrieve a specific query filter by its ID + * Get a dataset query filter by ID + */ + async getDatasetQueryFilterByIdRaw(requestParameters: DatasetQueryFilterApiGetDatasetQueryFilterByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['datasetId'] == null) { + throw new runtime.RequiredError( + 'datasetId', + 'Required parameter "datasetId" was null or undefined when calling getDatasetQueryFilterById().' + ); + } + + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getDatasetQueryFilterById().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/datasets/{datasetId}/query-filters/{id}`; + urlPath = urlPath.replace(`{${"datasetId"}}`, encodeURIComponent(String(requestParameters['datasetId']))); + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Retrieve a specific query filter by its ID + * Get a dataset query filter by ID + */ + async getDatasetQueryFilterById(requestParameters: DatasetQueryFilterApiGetDatasetQueryFilterByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getDatasetQueryFilterByIdRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get a list of all query filters for a specific dataset + * Get a list of dataset query filters + */ + async listDatasetQueryFiltersRaw(requestParameters: DatasetQueryFilterApiListDatasetQueryFiltersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['datasetId'] == null) { + throw new runtime.RequiredError( + 'datasetId', + 'Required parameter "datasetId" was null or undefined when calling listDatasetQueryFilters().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; + } + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/datasets/{datasetId}/query-filters`; + urlPath = urlPath.replace(`{${"datasetId"}}`, encodeURIComponent(String(requestParameters['datasetId']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Get a list of all query filters for a specific dataset + * Get a list of dataset query filters + */ + async listDatasetQueryFilters(requestParameters: DatasetQueryFilterApiListDatasetQueryFiltersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listDatasetQueryFiltersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update an existing query filter using JSON Merge Patch semantics + * Update a dataset query filter + */ + async updateDatasetQueryFilterRaw(requestParameters: DatasetQueryFilterApiUpdateDatasetQueryFilterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['datasetId'] == null) { + throw new runtime.RequiredError( + 'datasetId', + 'Required parameter "datasetId" was null or undefined when calling updateDatasetQueryFilter().' + ); + } + + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling updateDatasetQueryFilter().' + ); + } + + if (requestParameters['datasetQueryFilterUpdateRequest'] == null) { + throw new runtime.RequiredError( + 'datasetQueryFilterUpdateRequest', + 'Required parameter "datasetQueryFilterUpdateRequest" was null or undefined when calling updateDatasetQueryFilter().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/datasets/{datasetId}/query-filters/{id}`; + urlPath = urlPath.replace(`{${"datasetId"}}`, encodeURIComponent(String(requestParameters['datasetId']))); + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: requestParameters['datasetQueryFilterUpdateRequest'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Update an existing query filter using JSON Merge Patch semantics + * Update a dataset query filter + */ + async updateDatasetQueryFilter(requestParameters: DatasetQueryFilterApiUpdateDatasetQueryFilterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateDatasetQueryFilterRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/rest/generated/apis/DocumentationApi.ts b/src/rest/generated/apis/DocumentationApi.ts new file mode 100644 index 0000000..0e488d4 --- /dev/null +++ b/src/rest/generated/apis/DocumentationApi.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Observe API + * # Overview Welcome to the Observe API Docs! The Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded. ## Authentication Requests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication: ``` // passing token as bearer token curl -H \"Authorization: Bearer \" https://..com/v1/... ``` + * + * The version of the OpenAPI document: 1.0.230307 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + DocumentationSearchRequest, + DocumentationSearchResponse, + ErrorMessage, +} from '../models/index'; + +export interface DocumentationApiSearchDocumentationRequest { + documentationSearchRequest: DocumentationSearchRequest; +} + +/** + * + */ +export class DocumentationApi extends runtime.BaseAPI { + + /** + * Semantic search across Observe\'s built-in documentation. Given a natural-language query, returns the most relevant documentation chunks ranked by cosine similarity. Results are returned at the chunk level, not whole documents. A single documentation page may be split into multiple chunks, each with its own embedding and score. Multiple chunks from the same source page can appear in the results. + * Search documentation + */ + async searchDocumentationRaw(requestParameters: DocumentationApiSearchDocumentationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['documentationSearchRequest'] == null) { + throw new runtime.RequiredError( + 'documentationSearchRequest', + 'Required parameter "documentationSearchRequest" was null or undefined when calling searchDocumentation().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/documentation/search`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['documentationSearchRequest'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Semantic search across Observe\'s built-in documentation. Given a natural-language query, returns the most relevant documentation chunks ranked by cosine similarity. Results are returned at the chunk level, not whole documents. A single documentation page may be split into multiple chunks, each with its own embedding and score. Multiple chunks from the same source page can appear in the results. + * Search documentation + */ + async searchDocumentation(requestParameters: DocumentationApiSearchDocumentationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.searchDocumentationRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/rest/generated/apis/ExportApi.ts b/src/rest/generated/apis/ExportApi.ts new file mode 100644 index 0000000..31ab8d2 --- /dev/null +++ b/src/rest/generated/apis/ExportApi.ts @@ -0,0 +1,267 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Observe API + * # Overview Welcome to the Observe API Docs! The Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded. ## Authentication Requests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication: ``` // passing token as bearer token curl -H \"Authorization: Bearer \" https://..com/v1/... ``` + * + * The version of the OpenAPI document: 1.0.230307 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + ExportQueryRequest, +} from '../models/index'; + +export interface ExportApiExportQueryOperationRequest { + exportQueryRequest: ExportQueryRequest; + startTime?: string; + endTime?: string; + interval?: string; + stage?: string; + paginate?: boolean; +} + +export interface ExportApiExportQueryPageRequest { + cursorId: string; + offset?: string; + numRows?: string; +} + +export interface ExportApiExportWorksheetRequest { + worksheetId: number; + startTime?: string; + endTime?: string; + interval?: string; + stage?: string; +} + +/** + * + */ +export class ExportApi extends runtime.BaseAPI { + + /** + * Execute an OPAL query. Results can be returned as CSV or NDJSON. * Set Accept header to `text/csv` or `application/x-ndjson` * Default: CSV Either two of `startTime`, `endTime`, and `interval` or `interval` alone can be specified to set the time interval. The `startTime` parameter is inclusive and the `endTime` parameter is exclusive, to prevent overlap from subsequent windows. * `interval`: An interval relative to now * `startTime` + `endTime`: The specified time interval * `startTime` **or** `endTime` + `interval`: The specified time interval relative to the provided start or end time Inputs are specified as dataset IDs, or previously-defined stages. Set paginate to true for an asynchronous paginated mode. The response will be 202 Accepted and contain headers for fetching the results via `/v1/meta/export/query/page`. You may also want to increase rowCount to allow large, paginated queries. + * Execute an OPAL query + */ + async exportQueryRaw(requestParameters: ExportApiExportQueryOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['exportQueryRequest'] == null) { + throw new runtime.RequiredError( + 'exportQueryRequest', + 'Required parameter "exportQueryRequest" was null or undefined when calling exportQuery().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['startTime'] != null) { + queryParameters['startTime'] = requestParameters['startTime']; + } + + if (requestParameters['endTime'] != null) { + queryParameters['endTime'] = requestParameters['endTime']; + } + + if (requestParameters['interval'] != null) { + queryParameters['interval'] = requestParameters['interval']; + } + + if (requestParameters['stage'] != null) { + queryParameters['stage'] = requestParameters['stage']; + } + + if (requestParameters['paginate'] != null) { + queryParameters['paginate'] = requestParameters['paginate']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/meta/export/query`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['exportQueryRequest'], + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Execute an OPAL query. Results can be returned as CSV or NDJSON. * Set Accept header to `text/csv` or `application/x-ndjson` * Default: CSV Either two of `startTime`, `endTime`, and `interval` or `interval` alone can be specified to set the time interval. The `startTime` parameter is inclusive and the `endTime` parameter is exclusive, to prevent overlap from subsequent windows. * `interval`: An interval relative to now * `startTime` + `endTime`: The specified time interval * `startTime` **or** `endTime` + `interval`: The specified time interval relative to the provided start or end time Inputs are specified as dataset IDs, or previously-defined stages. Set paginate to true for an asynchronous paginated mode. The response will be 202 Accepted and contain headers for fetching the results via `/v1/meta/export/query/page`. You may also want to increase rowCount to allow large, paginated queries. + * Execute an OPAL query + */ + async exportQuery(requestParameters: ExportApiExportQueryOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportQueryRaw(requestParameters, initOverrides); + switch (response.raw.status) { + case 200: + return await response.value(); + case 202: + return null; + case 206: + return await response.value(); + default: + return await response.value(); + } + } + + /** + * Fetch the results of a paginated \"/v1/meta/export/query\" request. Note that paginate must be set to true and rowCount should be set high enough to contain the total expected result set. This endpoint uses long polling behavior. If a query is in progress when a request is made, the server will delay responding for up to 30 seconds. If the query completes in that time period, the results will be returned with a 200 response code. Otherwise a 202 response code will be returned, and the client should retry the request. The endpoint will also return an error if the query failed. Queries for paginated data will return an `X-Observe-Total-Rows` header and an `X-Observe-Next-Page` header with a URL for the next page, as long as one is needed. You can use the `X-Observe-Cursor-Id` and the `offset` and `numRows` parameters to construct your own next page URL with different page sizes. The results can be returned as CSV or NDJSON. The query parameters are used to specify which page of results to fetch. * Set Accept header to `text/csv` or `application/x-ndjson` * Default: CSV The number of rows in the full result set is returned in the X-Observe-Total-Rows response header. + * Fetch a page of query results + */ + async exportQueryPageRaw(requestParameters: ExportApiExportQueryPageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['cursorId'] == null) { + throw new runtime.RequiredError( + 'cursorId', + 'Required parameter "cursorId" was null or undefined when calling exportQueryPage().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['cursorId'] != null) { + queryParameters['cursorId'] = requestParameters['cursorId']; + } + + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; + } + + if (requestParameters['numRows'] != null) { + queryParameters['numRows'] = requestParameters['numRows']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/meta/export/query/page`; + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Fetch the results of a paginated \"/v1/meta/export/query\" request. Note that paginate must be set to true and rowCount should be set high enough to contain the total expected result set. This endpoint uses long polling behavior. If a query is in progress when a request is made, the server will delay responding for up to 30 seconds. If the query completes in that time period, the results will be returned with a 200 response code. Otherwise a 202 response code will be returned, and the client should retry the request. The endpoint will also return an error if the query failed. Queries for paginated data will return an `X-Observe-Total-Rows` header and an `X-Observe-Next-Page` header with a URL for the next page, as long as one is needed. You can use the `X-Observe-Cursor-Id` and the `offset` and `numRows` parameters to construct your own next page URL with different page sizes. The results can be returned as CSV or NDJSON. The query parameters are used to specify which page of results to fetch. * Set Accept header to `text/csv` or `application/x-ndjson` * Default: CSV The number of rows in the full result set is returned in the X-Observe-Total-Rows response header. + * Fetch a page of query results + */ + async exportQueryPage(requestParameters: ExportApiExportQueryPageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportQueryPageRaw(requestParameters, initOverrides); + switch (response.raw.status) { + case 200: + return await response.value(); + case 202: + return null; + default: + return await response.value(); + } + } + + /** + * Export data used by a worksheet. Results are limited to a maximum of 100,000 rows. Results can be returned as CSV or NDJSON. * Set Accept header to `text/csv` or `application/x-ndjson` * Default: CSV Either two of `startTime`, `endTime`, and `interval` or `interval` alone can be specified to set the time interval. The `startTime` parameter is inclusive and the `endTime` parameter is exclusive, to prevent overlap from subsequent windows. * `interval`: An interval relative to now * `startTime` + `endTime`: The specified time interval * `startTime` **or** `endTime` + `interval`: The specified time interval relative to the provided start or end time + * Export a worksheet + */ + async exportWorksheetRaw(requestParameters: ExportApiExportWorksheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['worksheetId'] == null) { + throw new runtime.RequiredError( + 'worksheetId', + 'Required parameter "worksheetId" was null or undefined when calling exportWorksheet().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['startTime'] != null) { + queryParameters['startTime'] = requestParameters['startTime']; + } + + if (requestParameters['endTime'] != null) { + queryParameters['endTime'] = requestParameters['endTime']; + } + + if (requestParameters['interval'] != null) { + queryParameters['interval'] = requestParameters['interval']; + } + + if (requestParameters['stage'] != null) { + queryParameters['stage'] = requestParameters['stage']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/meta/export/worksheet/{worksheetId}`; + urlPath = urlPath.replace(`{${"worksheetId"}}`, encodeURIComponent(String(requestParameters['worksheetId']))); + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Export data used by a worksheet. Results are limited to a maximum of 100,000 rows. Results can be returned as CSV or NDJSON. * Set Accept header to `text/csv` or `application/x-ndjson` * Default: CSV Either two of `startTime`, `endTime`, and `interval` or `interval` alone can be specified to set the time interval. The `startTime` parameter is inclusive and the `endTime` parameter is exclusive, to prevent overlap from subsequent windows. * `interval`: An interval relative to now * `startTime` + `endTime`: The specified time interval * `startTime` **or** `endTime` + `interval`: The specified time interval relative to the provided start or end time + * Export a worksheet + */ + async exportWorksheet(requestParameters: ExportApiExportWorksheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportWorksheetRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/rest/generated/apis/LoginApi.ts b/src/rest/generated/apis/LoginApi.ts new file mode 100644 index 0000000..d7f45e0 --- /dev/null +++ b/src/rest/generated/apis/LoginApi.ts @@ -0,0 +1,167 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Observe API + * # Overview Welcome to the Observe API Docs! The Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded. ## Authentication Requests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication: ``` // passing token as bearer token curl -H \"Authorization: Bearer \" https://..com/v1/... ``` + * + * The version of the OpenAPI document: 1.0.230307 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + GenerateAPITokenRequest, + PollDelegatedLogin200Response, + StartDelegatedLogin200Response, + StartDelegatedLogin400Response, + StartDelegatedLoginRequest, +} from '../models/index'; + +export interface LoginApiGenerateAPITokenOperationRequest { + generateAPITokenRequest: GenerateAPITokenRequest; +} + +export interface LoginApiPollDelegatedLoginRequest { + serverToken: string; +} + +export interface LoginApiStartDelegatedLoginOperationRequest { + startDelegatedLoginRequest: StartDelegatedLoginRequest; +} + +/** + * + */ +export class LoginApi extends runtime.BaseAPI { + + /** + * Given an email address and a password, generate an API authorization token. This token can be used with Bearer authorization when used together with the customer ID. (The customer ID is the same as the first number in the API server URL.) ``` Authorization: Bearer ``` Only \"local\" users that have a password can use this API; SSO users cannot log in using a password. This endpoint does not itself need to Authorization header. + * Generate an API token + */ + async generateAPITokenRaw(requestParameters: LoginApiGenerateAPITokenOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['generateAPITokenRequest'] == null) { + throw new runtime.RequiredError( + 'generateAPITokenRequest', + 'Required parameter "generateAPITokenRequest" was null or undefined when calling generateAPIToken().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/v1/login`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['generateAPITokenRequest'], + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Given an email address and a password, generate an API authorization token. This token can be used with Bearer authorization when used together with the customer ID. (The customer ID is the same as the first number in the API server URL.) ``` Authorization: Bearer ``` Only \"local\" users that have a password can use this API; SSO users cannot log in using a password. This endpoint does not itself need to Authorization header. + * Generate an API token + */ + async generateAPIToken(requestParameters: LoginApiGenerateAPITokenOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.generateAPITokenRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint polls the status of a pending login request. The serverToken is returned from the initial request, and is used to identify the request. + * Poll the status of a pending login request + */ + async pollDelegatedLoginRaw(requestParameters: LoginApiPollDelegatedLoginRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['serverToken'] == null) { + throw new runtime.RequiredError( + 'serverToken', + 'Required parameter "serverToken" was null or undefined when calling pollDelegatedLogin().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + + let urlPath = `/v1/login/delegated/{serverToken}`; + urlPath = urlPath.replace(`{${"serverToken"}}`, encodeURIComponent(String(requestParameters['serverToken']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * This endpoint polls the status of a pending login request. The serverToken is returned from the initial request, and is used to identify the request. + * Poll the status of a pending login request + */ + async pollDelegatedLogin(requestParameters: LoginApiPollDelegatedLoginRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.pollDelegatedLoginRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint starts an authorization flow that lets an Observe user generate an authorization token to use for external tools and scripts. This token will have the same powers as the user authorizing, and can be passed in the `Authorization: Bearer ` header of requqests. This endpoint will return with a URL that the user should visit in a web browser to allow the token creation; that URL will lead to a page that requires the user to be logged in (through whatever password or SSO mechanism the user normally uses.) The response from this endpoint also includes a \"serverToken\" field, which is a token that can be used to poll the tenant for the status of the token creation, and if successful, will return the issued access key. Essentially, this endpoint implements the Oauth \"device\" authorization flow. + * Start an Observe authtoken creation flow + */ + async startDelegatedLoginRaw(requestParameters: LoginApiStartDelegatedLoginOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['startDelegatedLoginRequest'] == null) { + throw new runtime.RequiredError( + 'startDelegatedLoginRequest', + 'Required parameter "startDelegatedLoginRequest" was null or undefined when calling startDelegatedLogin().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/v1/login/delegated`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['startDelegatedLoginRequest'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * This endpoint starts an authorization flow that lets an Observe user generate an authorization token to use for external tools and scripts. This token will have the same powers as the user authorizing, and can be passed in the `Authorization: Bearer ` header of requqests. This endpoint will return with a URL that the user should visit in a web browser to allow the token creation; that URL will lead to a page that requires the user to be logged in (through whatever password or SSO mechanism the user normally uses.) The response from this endpoint also includes a \"serverToken\" field, which is a token that can be used to poll the tenant for the status of the token creation, and if successful, will return the issued access key. Essentially, this endpoint implements the Oauth \"device\" authorization flow. + * Start an Observe authtoken creation flow + */ + async startDelegatedLogin(requestParameters: LoginApiStartDelegatedLoginOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.startDelegatedLoginRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/rest/generated/apis/MonitorApi.ts b/src/rest/generated/apis/MonitorApi.ts new file mode 100644 index 0000000..688d314 --- /dev/null +++ b/src/rest/generated/apis/MonitorApi.ts @@ -0,0 +1,480 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Observe API + * # Overview Welcome to the Observe API Docs! The Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded. ## Authentication Requests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication: ``` // passing token as bearer token curl -H \"Authorization: Bearer \" https://..com/v1/... ``` + * + * The version of the OpenAPI document: 1.0.230307 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + MonitorV2, + MonitorV2MuteRule, + MonitorV2MuteRuleTerse, + MonitorV2PatchRequest, + MonitorV2Terse, +} from '../models/index'; + +export interface MonitorApiCreateMonitorRequest { + monitorV2: Omit; +} + +export interface MonitorApiCreateMonitorMuteRuleRequest { + monitorV2MuteRule: Omit; +} + +export interface MonitorApiDeleteMonitorRequest { + id: number; +} + +export interface MonitorApiDeleteMonitorMuteRuleRequest { + id: number; +} + +export interface MonitorApiGetMonitorRequest { + id: number; +} + +export interface MonitorApiGetMonitorMuteRuleRequest { + id: number; +} + +export interface MonitorApiListMonitorMuteRulesRequest { + nameExact?: string; + nameSubstring?: string; +} + +export interface MonitorApiListMonitorsRequest { + nameExact?: string; + nameSubstring?: string; +} + +export interface MonitorApiUpdateMonitorRequest { + id: number; + monitorV2PatchRequest?: MonitorV2PatchRequest; +} + +/** + * + */ +export class MonitorApi extends runtime.BaseAPI { + + /** + * Create a new MonitorV2 and bind to actions + */ + async createMonitorRaw(requestParameters: MonitorApiCreateMonitorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['monitorV2'] == null) { + throw new runtime.RequiredError( + 'monitorV2', + 'Required parameter "monitorV2" was null or undefined when calling createMonitor().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/monitors`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['monitorV2'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Create a new MonitorV2 and bind to actions + */ + async createMonitor(requestParameters: MonitorApiCreateMonitorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createMonitorRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create a new MonitorV2 Mute Rule + */ + async createMonitorMuteRuleRaw(requestParameters: MonitorApiCreateMonitorMuteRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['monitorV2MuteRule'] == null) { + throw new runtime.RequiredError( + 'monitorV2MuteRule', + 'Required parameter "monitorV2MuteRule" was null or undefined when calling createMonitorMuteRule().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/monitor-mute-rules`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['monitorV2MuteRule'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Create a new MonitorV2 Mute Rule + */ + async createMonitorMuteRule(requestParameters: MonitorApiCreateMonitorMuteRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createMonitorMuteRuleRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete a MonitorV2 + */ + async deleteMonitorRaw(requestParameters: MonitorApiDeleteMonitorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling deleteMonitor().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/monitors/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a MonitorV2 + */ + async deleteMonitor(requestParameters: MonitorApiDeleteMonitorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteMonitorRaw(requestParameters, initOverrides); + } + + /** + * Delete a MonitorV2 Mute Rule + */ + async deleteMonitorMuteRuleRaw(requestParameters: MonitorApiDeleteMonitorMuteRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling deleteMonitorMuteRule().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/monitor-mute-rules/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a MonitorV2 Mute Rule + */ + async deleteMonitorMuteRule(requestParameters: MonitorApiDeleteMonitorMuteRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteMonitorMuteRuleRaw(requestParameters, initOverrides); + } + + /** + * Get a MonitorV2 + */ + async getMonitorRaw(requestParameters: MonitorApiGetMonitorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getMonitor().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/monitors/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Get a MonitorV2 + */ + async getMonitor(requestParameters: MonitorApiGetMonitorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getMonitorRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get a MonitorV2 Mute Rule + */ + async getMonitorMuteRuleRaw(requestParameters: MonitorApiGetMonitorMuteRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getMonitorMuteRule().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/monitor-mute-rules/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Get a MonitorV2 Mute Rule + */ + async getMonitorMuteRule(requestParameters: MonitorApiGetMonitorMuteRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getMonitorMuteRuleRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List MonitorV2 Mute Rules with optional filters + */ + async listMonitorMuteRulesRaw(requestParameters: MonitorApiListMonitorMuteRulesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters['nameExact'] != null) { + queryParameters['nameExact'] = requestParameters['nameExact']; + } + + if (requestParameters['nameSubstring'] != null) { + queryParameters['nameSubstring'] = requestParameters['nameSubstring']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/monitor-mute-rules`; + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * List MonitorV2 Mute Rules with optional filters + */ + async listMonitorMuteRules(requestParameters: MonitorApiListMonitorMuteRulesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.listMonitorMuteRulesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List MonitorV2 instances with optional filters + */ + async listMonitorsRaw(requestParameters: MonitorApiListMonitorsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters['nameExact'] != null) { + queryParameters['nameExact'] = requestParameters['nameExact']; + } + + if (requestParameters['nameSubstring'] != null) { + queryParameters['nameSubstring'] = requestParameters['nameSubstring']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/monitors`; + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * List MonitorV2 instances with optional filters + */ + async listMonitors(requestParameters: MonitorApiListMonitorsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.listMonitorsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Partially updates a monitor. Only **PATCH** is supported for this URL. **Top-level merge:** The server reads the current monitor, then for each of these properties—`name`, `disabled`, `description`, `ruleKind`, `definition`, `actionRules`—uses the request value if the key is present in the body, otherwise keeps the stored value. Keys omitted from the body do not change. **Replace entire subtrees:** If `definition` or `actionRules` appears in the body, it **replaces the whole** stored `definition` or `actionRules` value. The server does **not** deep-merge inside `definition`, inside individual action rules, or inside nested structures (for example an action rule’s `definition`). To change part of the monitor definition or action configuration, send the complete `definition` and/or full `actionRules` array you want saved. **Not controlled by the body:** Other monitor fields (such as `id` from the path, or `monitorVersion`) are not updated from this JSON body using the merge rules above. **Extra properties:** Any other top-level JSON properties in the body are ignored for this merge (they are not written to the monitor). + * Update a MonitorV2 + */ + async updateMonitorRaw(requestParameters: MonitorApiUpdateMonitorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling updateMonitor().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/monitors/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: requestParameters['monitorV2PatchRequest'], + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Partially updates a monitor. Only **PATCH** is supported for this URL. **Top-level merge:** The server reads the current monitor, then for each of these properties—`name`, `disabled`, `description`, `ruleKind`, `definition`, `actionRules`—uses the request value if the key is present in the body, otherwise keeps the stored value. Keys omitted from the body do not change. **Replace entire subtrees:** If `definition` or `actionRules` appears in the body, it **replaces the whole** stored `definition` or `actionRules` value. The server does **not** deep-merge inside `definition`, inside individual action rules, or inside nested structures (for example an action rule’s `definition`). To change part of the monitor definition or action configuration, send the complete `definition` and/or full `actionRules` array you want saved. **Not controlled by the body:** Other monitor fields (such as `id` from the path, or `monitorVersion`) are not updated from this JSON body using the merge rules above. **Extra properties:** Any other top-level JSON properties in the body are ignored for this merge (they are not written to the monitor). + * Update a MonitorV2 + */ + async updateMonitor(requestParameters: MonitorApiUpdateMonitorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.updateMonitorRaw(requestParameters, initOverrides); + } + +} diff --git a/src/rest/generated/apis/MonitorMuteApi.ts b/src/rest/generated/apis/MonitorMuteApi.ts new file mode 100644 index 0000000..732065f --- /dev/null +++ b/src/rest/generated/apis/MonitorMuteApi.ts @@ -0,0 +1,314 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Observe API + * # Overview Welcome to the Observe API Docs! The Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded. ## Authentication Requests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication: ``` // passing token as bearer token curl -H \"Authorization: Bearer \" https://..com/v1/... ``` + * + * The version of the OpenAPI document: 1.0.230307 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + ErrorMessage, + MonitorMuteCreateRequest, + MonitorMuteListResponse, + MonitorMuteResource, + MonitorMuteUpdateRequest, +} from '../models/index'; + +export interface MonitorMuteApiCreateMonitorMuteRequest { + monitorMuteCreateRequest: MonitorMuteCreateRequest; +} + +export interface MonitorMuteApiDeleteMonitorMuteRequest { + id: string; +} + +export interface MonitorMuteApiGetMonitorMuteRequest { + id: string; + expand?: boolean; +} + +export interface MonitorMuteApiListMonitorMutesRequest { + filter?: string; + expand?: boolean; + limit?: number; + offset?: number; + orderBy?: string; +} + +export interface MonitorMuteApiUpdateMonitorMuteRequest { + id: string; + monitorMuteUpdateRequest: MonitorMuteUpdateRequest; +} + +/** + * + */ +export class MonitorMuteApi extends runtime.BaseAPI { + + /** + * Create a monitor mute + */ + async createMonitorMuteRaw(requestParameters: MonitorMuteApiCreateMonitorMuteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['monitorMuteCreateRequest'] == null) { + throw new runtime.RequiredError( + 'monitorMuteCreateRequest', + 'Required parameter "monitorMuteCreateRequest" was null or undefined when calling createMonitorMute().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/monitor-mutes`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['monitorMuteCreateRequest'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Create a monitor mute + */ + async createMonitorMute(requestParameters: MonitorMuteApiCreateMonitorMuteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createMonitorMuteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete a monitor mute + */ + async deleteMonitorMuteRaw(requestParameters: MonitorMuteApiDeleteMonitorMuteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling deleteMonitorMute().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/monitor-mutes/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a monitor mute + */ + async deleteMonitorMute(requestParameters: MonitorMuteApiDeleteMonitorMuteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteMonitorMuteRaw(requestParameters, initOverrides); + } + + /** + * Retrieve a specific monitor mute rule by ID. + * Get a monitor mute + */ + async getMonitorMuteRaw(requestParameters: MonitorMuteApiGetMonitorMuteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getMonitorMute().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/monitor-mutes/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Retrieve a specific monitor mute rule by ID. + * Get a monitor mute + */ + async getMonitorMute(requestParameters: MonitorMuteApiGetMonitorMuteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getMonitorMuteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns a paginated list of monitor mute rules, optionally filtered by a CEL expression. + * List monitor mutes + */ + async listMonitorMutesRaw(requestParameters: MonitorMuteApiListMonitorMutesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters['filter'] != null) { + queryParameters['filter'] = requestParameters['filter']; + } + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/monitor-mutes`; + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns a paginated list of monitor mute rules, optionally filtered by a CEL expression. + * List monitor mutes + */ + async listMonitorMutes(requestParameters: MonitorMuteApiListMonitorMutesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listMonitorMutesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Partially updates a monitor mute rule using JSON Merge Patch semantics. Only provided fields are updated; omitted fields remain unchanged. `target.kind` is immutable after creation; sending a `target` object replaces the entire target subtree atomically. + * Update a monitor mute + */ + async updateMonitorMuteRaw(requestParameters: MonitorMuteApiUpdateMonitorMuteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling updateMonitorMute().' + ); + } + + if (requestParameters['monitorMuteUpdateRequest'] == null) { + throw new runtime.RequiredError( + 'monitorMuteUpdateRequest', + 'Required parameter "monitorMuteUpdateRequest" was null or undefined when calling updateMonitorMute().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/monitor-mutes/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: requestParameters['monitorMuteUpdateRequest'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Partially updates a monitor mute rule using JSON Merge Patch semantics. Only provided fields are updated; omitted fields remain unchanged. `target.kind` is immutable after creation; sending a `target` object replaces the entire target subtree atomically. + * Update a monitor mute + */ + async updateMonitorMute(requestParameters: MonitorMuteApiUpdateMonitorMuteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateMonitorMuteRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/rest/generated/apis/ReferenceTablesApi.ts b/src/rest/generated/apis/ReferenceTablesApi.ts new file mode 100644 index 0000000..42c87d5 --- /dev/null +++ b/src/rest/generated/apis/ReferenceTablesApi.ts @@ -0,0 +1,420 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Observe API + * # Overview Welcome to the Observe API Docs! The Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded. ## Authentication Requests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication: ``` // passing token as bearer token curl -H \"Authorization: Bearer \" https://..com/v1/... ``` + * + * The version of the OpenAPI document: 1.0.230307 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + ErrorMessage, + QueryReferenceTables200Response, + ReferenceTablesTable, + ReferenceTablesTableMetadata, + ReferenceTablesTableMetadataPatch, + UpdateReferenceTable200Response, +} from '../models/index'; + +export interface ReferenceTablesApiCreateReferenceTableRequest { + metadata?: ReferenceTablesTableMetadata; + upload?: Blob; + schema?: Blob; +} + +export interface ReferenceTablesApiDeleteReferenceTableRequest { + id: string; +} + +export interface ReferenceTablesApiGetReferenceTableRequest { + id: string; +} + +export interface ReferenceTablesApiQueryReferenceTablesRequest { + label?: string; + createdBy?: string; + limit?: number; + offset?: number; +} + +export interface ReferenceTablesApiUpdateReferenceTableRequest { + id: string; + metadata?: ReferenceTablesTableMetadata; + upload?: Blob; + schema?: Blob; +} + +export interface ReferenceTablesApiUpdateReferenceTableMetadataRequest { + id: string; + referenceTablesTableMetadataPatch: ReferenceTablesTableMetadataPatch; +} + +/** + * + */ +export class ReferenceTablesApi extends runtime.BaseAPI { + + /** + * Creates a new reference table with the specified parameters and uploaded data. + * Create a new reference table + */ + async createReferenceTableRaw(requestParameters: ReferenceTablesApiCreateReferenceTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters['metadata'] != null) { + + formParams.append('metadata', new Blob([JSON.stringify(requestParameters['metadata'])], { type: "application/json", })); + } + + if (requestParameters['upload'] != null) { + formParams.append('upload', requestParameters['upload'] as any); + } + + if (requestParameters['schema'] != null) { + formParams.append('schema', requestParameters['schema'] as any); + } + + + let urlPath = `/v1/referencetables`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Creates a new reference table with the specified parameters and uploaded data. + * Create a new reference table + */ + async createReferenceTable(requestParameters: ReferenceTablesApiCreateReferenceTableRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createReferenceTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes a reference table with the specified ID. + * Delete a reference table + */ + async deleteReferenceTableRaw(requestParameters: ReferenceTablesApiDeleteReferenceTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling deleteReferenceTable().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/referencetables/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deletes a reference table with the specified ID. + * Delete a reference table + */ + async deleteReferenceTable(requestParameters: ReferenceTablesApiDeleteReferenceTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteReferenceTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve a specific reference table by ID. + * Get a reference table + */ + async getReferenceTableRaw(requestParameters: ReferenceTablesApiGetReferenceTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getReferenceTable().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/referencetables/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Retrieve a specific reference table by ID. + * Get a reference table + */ + async getReferenceTable(requestParameters: ReferenceTablesApiGetReferenceTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getReferenceTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Search for reference tables with optional filters (label, createdBy) and pagination. + * Query reference tables + */ + async queryReferenceTablesRaw(requestParameters: ReferenceTablesApiQueryReferenceTablesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters['label'] != null) { + queryParameters['label'] = requestParameters['label']; + } + + if (requestParameters['createdBy'] != null) { + queryParameters['createdBy'] = requestParameters['createdBy']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/referencetables`; + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Search for reference tables with optional filters (label, createdBy) and pagination. + * Query reference tables + */ + async queryReferenceTables(requestParameters: ReferenceTablesApiQueryReferenceTablesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.queryReferenceTablesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Replaces a reference table with the specified ID. + * Replace a reference table + */ + async updateReferenceTableRaw(requestParameters: ReferenceTablesApiUpdateReferenceTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling updateReferenceTable().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters['metadata'] != null) { + + formParams.append('metadata', new Blob([JSON.stringify(requestParameters['metadata'])], { type: "application/json", })); + } + + if (requestParameters['upload'] != null) { + formParams.append('upload', requestParameters['upload'] as any); + } + + if (requestParameters['schema'] != null) { + formParams.append('schema', requestParameters['schema'] as any); + } + + + let urlPath = `/v1/referencetables/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: formParams, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Replaces a reference table with the specified ID. + * Replace a reference table + */ + async updateReferenceTable(requestParameters: ReferenceTablesApiUpdateReferenceTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateReferenceTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Updates the metadata of a reference table with the specified ID. + * Update metadata of a reference table + */ + async updateReferenceTableMetadataRaw(requestParameters: ReferenceTablesApiUpdateReferenceTableMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling updateReferenceTableMetadata().' + ); + } + + if (requestParameters['referenceTablesTableMetadataPatch'] == null) { + throw new runtime.RequiredError( + 'referenceTablesTableMetadataPatch', + 'Required parameter "referenceTablesTableMetadataPatch" was null or undefined when calling updateReferenceTableMetadata().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/referencetables/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: requestParameters['referenceTablesTableMetadataPatch'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Updates the metadata of a reference table with the specified ID. + * Update metadata of a reference table + */ + async updateReferenceTableMetadata(requestParameters: ReferenceTablesApiUpdateReferenceTableMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateReferenceTableMetadataRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/rest/generated/apis/ServiceAccountsApi.ts b/src/rest/generated/apis/ServiceAccountsApi.ts new file mode 100644 index 0000000..d3836cf --- /dev/null +++ b/src/rest/generated/apis/ServiceAccountsApi.ts @@ -0,0 +1,623 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Observe API + * # Overview Welcome to the Observe API Docs! The Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded. ## Authentication Requests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication: ``` // passing token as bearer token curl -H \"Authorization: Bearer \" https://..com/v1/... ``` + * + * The version of the OpenAPI document: 1.0.230307 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + ApiTokenCreateRequest, + ApiTokenListResponse, + ApiTokenResource, + ApiTokenUpdateRequest, + ErrorMessage, + ServiceAccountCreateRequest, + ServiceAccountListResponse, + ServiceAccountResource, + ServiceAccountUpdateRequest, +} from '../models/index'; + +export interface ServiceAccountsApiCreateApiTokenRequest { + accountId: string; + apiTokenCreateRequest: ApiTokenCreateRequest; + expand?: boolean; +} + +export interface ServiceAccountsApiCreateServiceAccountRequest { + serviceAccountCreateRequest: ServiceAccountCreateRequest; + expand?: boolean; +} + +export interface ServiceAccountsApiDeleteApiTokenRequest { + accountId: string; + tokenId: string; +} + +export interface ServiceAccountsApiDeleteServiceAccountRequest { + accountId: string; +} + +export interface ServiceAccountsApiGetApiTokenRequest { + accountId: string; + tokenId: string; + expand?: boolean; +} + +export interface ServiceAccountsApiGetServiceAccountRequest { + accountId: string; + expand?: boolean; +} + +export interface ServiceAccountsApiListApiTokensRequest { + accountId: string; + expand?: boolean; +} + +export interface ServiceAccountsApiListServiceAccountsRequest { + expand?: boolean; +} + +export interface ServiceAccountsApiUpdateApiTokenRequest { + accountId: string; + tokenId: string; + apiTokenUpdateRequest: ApiTokenUpdateRequest; + expand?: boolean; +} + +export interface ServiceAccountsApiUpdateServiceAccountRequest { + accountId: string; + serviceAccountUpdateRequest: ServiceAccountUpdateRequest; + expand?: boolean; +} + +/** + * + */ +export class ServiceAccountsApi extends runtime.BaseAPI { + + /** + * Create an API token + */ + async createApiTokenRaw(requestParameters: ServiceAccountsApiCreateApiTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling createApiToken().' + ); + } + + if (requestParameters['apiTokenCreateRequest'] == null) { + throw new runtime.RequiredError( + 'apiTokenCreateRequest', + 'Required parameter "apiTokenCreateRequest" was null or undefined when calling createApiToken().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/service-accounts/{accountId}/api-tokens`; + urlPath = urlPath.replace(`{${"accountId"}}`, encodeURIComponent(String(requestParameters['accountId']))); + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['apiTokenCreateRequest'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Create an API token + */ + async createApiToken(requestParameters: ServiceAccountsApiCreateApiTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createApiTokenRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create a service account + */ + async createServiceAccountRaw(requestParameters: ServiceAccountsApiCreateServiceAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['serviceAccountCreateRequest'] == null) { + throw new runtime.RequiredError( + 'serviceAccountCreateRequest', + 'Required parameter "serviceAccountCreateRequest" was null or undefined when calling createServiceAccount().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/service-accounts`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['serviceAccountCreateRequest'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Create a service account + */ + async createServiceAccount(requestParameters: ServiceAccountsApiCreateServiceAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createServiceAccountRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete an API token + */ + async deleteApiTokenRaw(requestParameters: ServiceAccountsApiDeleteApiTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling deleteApiToken().' + ); + } + + if (requestParameters['tokenId'] == null) { + throw new runtime.RequiredError( + 'tokenId', + 'Required parameter "tokenId" was null or undefined when calling deleteApiToken().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/service-accounts/{accountId}/api-tokens/{tokenId}`; + urlPath = urlPath.replace(`{${"accountId"}}`, encodeURIComponent(String(requestParameters['accountId']))); + urlPath = urlPath.replace(`{${"tokenId"}}`, encodeURIComponent(String(requestParameters['tokenId']))); + + const response = await this.request({ + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete an API token + */ + async deleteApiToken(requestParameters: ServiceAccountsApiDeleteApiTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteApiTokenRaw(requestParameters, initOverrides); + } + + /** + * Delete a service account + */ + async deleteServiceAccountRaw(requestParameters: ServiceAccountsApiDeleteServiceAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling deleteServiceAccount().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/service-accounts/{accountId}`; + urlPath = urlPath.replace(`{${"accountId"}}`, encodeURIComponent(String(requestParameters['accountId']))); + + const response = await this.request({ + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a service account + */ + async deleteServiceAccount(requestParameters: ServiceAccountsApiDeleteServiceAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteServiceAccountRaw(requestParameters, initOverrides); + } + + /** + * Retrieve a specific API token by ID + * Get an API token + */ + async getApiTokenRaw(requestParameters: ServiceAccountsApiGetApiTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getApiToken().' + ); + } + + if (requestParameters['tokenId'] == null) { + throw new runtime.RequiredError( + 'tokenId', + 'Required parameter "tokenId" was null or undefined when calling getApiToken().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/service-accounts/{accountId}/api-tokens/{tokenId}`; + urlPath = urlPath.replace(`{${"accountId"}}`, encodeURIComponent(String(requestParameters['accountId']))); + urlPath = urlPath.replace(`{${"tokenId"}}`, encodeURIComponent(String(requestParameters['tokenId']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Retrieve a specific API token by ID + * Get an API token + */ + async getApiToken(requestParameters: ServiceAccountsApiGetApiTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getApiTokenRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve a specific service account by ID + * Get a service account + */ + async getServiceAccountRaw(requestParameters: ServiceAccountsApiGetServiceAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getServiceAccount().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/service-accounts/{accountId}`; + urlPath = urlPath.replace(`{${"accountId"}}`, encodeURIComponent(String(requestParameters['accountId']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Retrieve a specific service account by ID + * Get a service account + */ + async getServiceAccount(requestParameters: ServiceAccountsApiGetServiceAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getServiceAccountRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get a list of all API tokens for this service account + * Get a list of API tokens for this service account + */ + async listApiTokensRaw(requestParameters: ServiceAccountsApiListApiTokensRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling listApiTokens().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/service-accounts/{accountId}/api-tokens`; + urlPath = urlPath.replace(`{${"accountId"}}`, encodeURIComponent(String(requestParameters['accountId']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Get a list of all API tokens for this service account + * Get a list of API tokens for this service account + */ + async listApiTokens(requestParameters: ServiceAccountsApiListApiTokensRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listApiTokensRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get a list of all service accounts + * Get a list of service accounts + */ + async listServiceAccountsRaw(requestParameters: ServiceAccountsApiListServiceAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/service-accounts`; + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Get a list of all service accounts + * Get a list of service accounts + */ + async listServiceAccounts(requestParameters: ServiceAccountsApiListServiceAccountsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listServiceAccountsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update an API token + */ + async updateApiTokenRaw(requestParameters: ServiceAccountsApiUpdateApiTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling updateApiToken().' + ); + } + + if (requestParameters['tokenId'] == null) { + throw new runtime.RequiredError( + 'tokenId', + 'Required parameter "tokenId" was null or undefined when calling updateApiToken().' + ); + } + + if (requestParameters['apiTokenUpdateRequest'] == null) { + throw new runtime.RequiredError( + 'apiTokenUpdateRequest', + 'Required parameter "apiTokenUpdateRequest" was null or undefined when calling updateApiToken().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/service-accounts/{accountId}/api-tokens/{tokenId}`; + urlPath = urlPath.replace(`{${"accountId"}}`, encodeURIComponent(String(requestParameters['accountId']))); + urlPath = urlPath.replace(`{${"tokenId"}}`, encodeURIComponent(String(requestParameters['tokenId']))); + + const response = await this.request({ + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: requestParameters['apiTokenUpdateRequest'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Update an API token + */ + async updateApiToken(requestParameters: ServiceAccountsApiUpdateApiTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateApiTokenRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update a service account + */ + async updateServiceAccountRaw(requestParameters: ServiceAccountsApiUpdateServiceAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling updateServiceAccount().' + ); + } + + if (requestParameters['serviceAccountUpdateRequest'] == null) { + throw new runtime.RequiredError( + 'serviceAccountUpdateRequest', + 'Required parameter "serviceAccountUpdateRequest" was null or undefined when calling updateServiceAccount().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['expand'] != null) { + queryParameters['expand'] = requestParameters['expand']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1/service-accounts/{accountId}`; + urlPath = urlPath.replace(`{${"accountId"}}`, encodeURIComponent(String(requestParameters['accountId']))); + + const response = await this.request({ + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: requestParameters['serviceAccountUpdateRequest'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Update a service account + */ + async updateServiceAccount(requestParameters: ServiceAccountsApiUpdateServiceAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateServiceAccountRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/rest/generated/apis/index.ts b/src/rest/generated/apis/index.ts new file mode 100644 index 0000000..21c8ad0 --- /dev/null +++ b/src/rest/generated/apis/index.ts @@ -0,0 +1,13 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './AlertApi'; +export * from './DatasetApi'; +export * from './DatasetLegacyApi'; +export * from './DatasetQueryFilterApi'; +export * from './DocumentationApi'; +export * from './ExportApi'; +export * from './LoginApi'; +export * from './MonitorApi'; +export * from './MonitorMuteApi'; +export * from './ReferenceTablesApi'; +export * from './ServiceAccountsApi'; diff --git a/src/rest/generated/docs/AlertActionStats.md b/src/rest/generated/docs/AlertActionStats.md new file mode 100644 index 0000000..37ae6a5 --- /dev/null +++ b/src/rest/generated/docs/AlertActionStats.md @@ -0,0 +1,21 @@ + +# AlertActionStats + +Statistics about notification actions taken for this alert + +## Properties + +Name | Type +------------ | ------------- +`numNotifsDiscarded` | string +`numNotifsMuted` | string +`lastMutedAt` | string +`numNotifsSent` | string +`lastSentAt` | string +`numErrors` | string +`lastErroredAt` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertApi.md b/src/rest/generated/docs/AlertApi.md new file mode 100644 index 0000000..0934f1a --- /dev/null +++ b/src/rest/generated/docs/AlertApi.md @@ -0,0 +1,190 @@ +# AlertApi + +All URIs are relative to *https://OBSERVE_CUSTOMERID.observeinc.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getAlert**](AlertApi.md#getalert) | **GET** /v1/alerts/{id} | Get an alert by id | +| [**listAlerts**](AlertApi.md#listalerts) | **GET** /v1/alerts | List alerts | + + + +## getAlert + +> AlertResource getAlert(id, expand) + +Get an alert by id + +Get a single alert by its unique id. Unlike the list endpoint, this lookup is not time-windowed: it returns the alert regardless of how long ago it fired. Returns 404 if no alert with the given id exists in the workspace or if the caller lacks view permission on the alert\'s monitor. + +### Example + +```ts +import { + Configuration, + AlertApi, +} from ''; +import type { GetAlertRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new AlertApi(config); + + const body = { + // string | Unique identifier of the alert. + id: 38400000-8cf0-11bd-b23e-10b96e4ef00d, + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + } satisfies GetAlertRequest; + + try { + const data = await api.getAlert(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Unique identifier of the alert. | [Defaults to `undefined`] | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | + +### Return type + +[**AlertResource**](AlertResource.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Alert found | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listAlerts + +> AlertListResponse listAlerts(filter, orderBy, startTime, endTime, activeAt, offset, limit, expand, includeFacets) + +List alerts + +List monitor alerts, optionally filtering and sorting the response. Filters are specified in the [CEL query language](https://cel.dev). Supported orderBy fields: id, level, status, start, monitor.id, monitor.label. Time scoping can be provided in two ways (mutually exclusive): - startTime/endTime: a time range. Alerts overlapping this range are returned. Defaults to the last 24 hours. - activeAt: a single timestamp. Returns alerts that were active at that moment. If both activeAt and startTime/endTime are provided, returns 400. Default page size is 200, maximum is 1000. + +### Example + +```ts +import { + Configuration, + AlertApi, +} from ''; +import type { ListAlertsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new AlertApi(config); + + const body = { + // string | Filter that response alerts must match. Specified in CEL format. Note that filter expressions must be URL encoded. Supported filter fields: - `id` (string): unique alert identifier - `level` (string): one of `Critical`, `Error`, `Warning`, `Informational`, `NoData`, `None` - `status` (string): one of `Active`, `Ended`, `Retracted` - `monitor.id` (int): ID of the monitor that generated the alert - `monitor.label` (string): display label of the monitor (supports `.contains()`, `.startsWith()`, `.endsWith()`) - `muted` (bool): whether the alert is muted (`true` / `false`) - `context.` (string): context value by key, where `` is a GroupBy column name from the monitor definition. Use dot notation to access context fields. Supports `.contains()`, `.startsWith()`, `.endsWith()`. (optional) + filter: muted == true, + // string | A comma-separated list of field expressions to sort by. Prefix a field with - for descending order (default is ascending). Default sort is by start time, descending. (optional) + orderBy: -start, + // string | Start of the time range to query. Alerts that overlap this range are returned (i.e., alerts whose end time is after startTime, or that are still active). Defaults to 24 hours ago if not provided. (optional) + startTime: startTime_example, + // string | End of the time range to query. Alerts whose start time is before endTime are returned. Defaults to current time if not provided. (optional) + endTime: endTime_example, + // string | A single timestamp to query alerts that were active at that moment. Returns alerts where start <= activeAt and (end >= activeAt or the alert is still active). Mutually exclusive with startTime and endTime — if both are provided, returns 400. (optional) + activeAt: activeAt_example, + // number | Number of items to skip before starting to collect the result set (optional) + offset: 789, + // number | Maximum number of items to return in the response (optional) + limit: 789, + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + // boolean | When true, the response includes faceted counts for key alert attributes, computed over all alerts in the requested time window. These counts ignore any `filter`, `orderBy`, `offset`, or `limit` parameters, making them suitable for building filter panels. (optional) + includeFacets: true, + } satisfies ListAlertsRequest; + + try { + const data = await api.listAlerts(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **filter** | `string` | Filter that response alerts must match. Specified in CEL format. Note that filter expressions must be URL encoded. Supported filter fields: - `id` (string): unique alert identifier - `level` (string): one of `Critical`, `Error`, `Warning`, `Informational`, `NoData`, `None` - `status` (string): one of `Active`, `Ended`, `Retracted` - `monitor.id` (int): ID of the monitor that generated the alert - `monitor.label` (string): display label of the monitor (supports `.contains()`, `.startsWith()`, `.endsWith()`) - `muted` (bool): whether the alert is muted (`true` / `false`) - `context.<key>` (string): context value by key, where `<key>` is a GroupBy column name from the monitor definition. Use dot notation to access context fields. Supports `.contains()`, `.startsWith()`, `.endsWith()`. | [Optional] [Defaults to `undefined`] | +| **orderBy** | `string` | A comma-separated list of field expressions to sort by. Prefix a field with - for descending order (default is ascending). Default sort is by start time, descending. | [Optional] [Defaults to `undefined`] | +| **startTime** | `string` | Start of the time range to query. Alerts that overlap this range are returned (i.e., alerts whose end time is after startTime, or that are still active). Defaults to 24 hours ago if not provided. | [Optional] [Defaults to `undefined`] | +| **endTime** | `string` | End of the time range to query. Alerts whose start time is before endTime are returned. Defaults to current time if not provided. | [Optional] [Defaults to `undefined`] | +| **activeAt** | `string` | A single timestamp to query alerts that were active at that moment. Returns alerts where start <= activeAt and (end >= activeAt or the alert is still active). Mutually exclusive with startTime and endTime — if both are provided, returns 400. | [Optional] [Defaults to `undefined`] | +| **offset** | `number` | Number of items to skip before starting to collect the result set | [Optional] [Defaults to `undefined`] | +| **limit** | `number` | Maximum number of items to return in the response | [Optional] [Defaults to `undefined`] | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | +| **includeFacets** | `boolean` | When true, the response includes faceted counts for key alert attributes, computed over all alerts in the requested time window. These counts ignore any `filter`, `orderBy`, `offset`, or `limit` parameters, making them suitable for building filter panels. | [Optional] [Defaults to `undefined`] | + +### Return type + +[**AlertListResponse**](AlertListResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Alerts queried successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/src/rest/generated/docs/AlertCapturedValue.md b/src/rest/generated/docs/AlertCapturedValue.md new file mode 100644 index 0000000..8f46af4 --- /dev/null +++ b/src/rest/generated/docs/AlertCapturedValue.md @@ -0,0 +1,17 @@ + +# AlertCapturedValue + +A value captured at the time the alert was triggered + +## Properties + +Name | Type +------------ | ------------- +`types` | [Array<AlertCapturedValueType>](AlertCapturedValueType.md) +`column` | [AlertColumn](AlertColumn.md) +`value` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertCapturedValueType.md b/src/rest/generated/docs/AlertCapturedValueType.md new file mode 100644 index 0000000..86f37ff --- /dev/null +++ b/src/rest/generated/docs/AlertCapturedValueType.md @@ -0,0 +1,13 @@ + +# AlertCapturedValueType + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertColumn.md b/src/rest/generated/docs/AlertColumn.md new file mode 100644 index 0000000..efd5e3c --- /dev/null +++ b/src/rest/generated/docs/AlertColumn.md @@ -0,0 +1,17 @@ + +# AlertColumn + +A column reference, either a direct column path, a link column, or a correlation tag. Exactly one of `linkColumn`, `columnPath`, or `correlationTag` is non-null. + +## Properties + +Name | Type +------------ | ------------- +`linkColumn` | [AlertLinkColumn](AlertLinkColumn.md) +`columnPath` | [AlertColumnPath](AlertColumnPath.md) +`correlationTag` | [AlertCorrelationTag](AlertCorrelationTag.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertColumnPath.md b/src/rest/generated/docs/AlertColumnPath.md new file mode 100644 index 0000000..5087cf9 --- /dev/null +++ b/src/rest/generated/docs/AlertColumnPath.md @@ -0,0 +1,15 @@ + +# AlertColumnPath + + +## Properties + +Name | Type +------------ | ------------- +`name` | string +`path` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertContextEntry.md b/src/rest/generated/docs/AlertContextEntry.md new file mode 100644 index 0000000..b4789f2 --- /dev/null +++ b/src/rest/generated/docs/AlertContextEntry.md @@ -0,0 +1,16 @@ + +# AlertContextEntry + +A context entry representing a grouping value for which the alert triggered + +## Properties + +Name | Type +------------ | ------------- +`column` | [AlertColumn](AlertColumn.md) +`value` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertCorrelationTag.md b/src/rest/generated/docs/AlertCorrelationTag.md new file mode 100644 index 0000000..1916be6 --- /dev/null +++ b/src/rest/generated/docs/AlertCorrelationTag.md @@ -0,0 +1,15 @@ + +# AlertCorrelationTag + +A correlation tag reference. The tag identifier is the canonical name; the resolved backing column(s) are server-side details and not part of the wire shape. + +## Properties + +Name | Type +------------ | ------------- +`tag` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertFacetEntry.md b/src/rest/generated/docs/AlertFacetEntry.md new file mode 100644 index 0000000..fe2cf6f --- /dev/null +++ b/src/rest/generated/docs/AlertFacetEntry.md @@ -0,0 +1,17 @@ + +# AlertFacetEntry + +A single facet value and its alert count. + +## Properties + +Name | Type +------------ | ------------- +`key` | string +`label` | string +`count` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertFacets.md b/src/rest/generated/docs/AlertFacets.md new file mode 100644 index 0000000..a11f886 --- /dev/null +++ b/src/rest/generated/docs/AlertFacets.md @@ -0,0 +1,18 @@ + +# AlertFacets + +Faceted counts of all alerts in the requested time window, grouped by key attributes. Computed independently of any filter or pagination parameters. + +## Properties + +Name | Type +------------ | ------------- +`byStatus` | [Array<AlertFacetEntry>](AlertFacetEntry.md) +`byLevel` | [Array<AlertFacetEntry>](AlertFacetEntry.md) +`byMonitor` | [Array<AlertFacetEntry>](AlertFacetEntry.md) +`byMuted` | [Array<AlertFacetEntry>](AlertFacetEntry.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertLevel.md b/src/rest/generated/docs/AlertLevel.md new file mode 100644 index 0000000..e5f34a9 --- /dev/null +++ b/src/rest/generated/docs/AlertLevel.md @@ -0,0 +1,14 @@ + +# AlertLevel + +Severity level of the alert + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertLinkColumn.md b/src/rest/generated/docs/AlertLinkColumn.md new file mode 100644 index 0000000..9dbd2a5 --- /dev/null +++ b/src/rest/generated/docs/AlertLinkColumn.md @@ -0,0 +1,15 @@ + +# AlertLinkColumn + + +## Properties + +Name | Type +------------ | ------------- +`name` | string +`meta` | [AlertLinkColumnMeta](AlertLinkColumnMeta.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertLinkColumnMeta.md b/src/rest/generated/docs/AlertLinkColumnMeta.md new file mode 100644 index 0000000..bb69ffb --- /dev/null +++ b/src/rest/generated/docs/AlertLinkColumnMeta.md @@ -0,0 +1,16 @@ + +# AlertLinkColumnMeta + + +## Properties + +Name | Type +------------ | ------------- +`srcFields` | [Array<AlertColumnPath>](AlertColumnPath.md) +`dstFields` | Array<string> +`targetDataset` | [ObjectRef](ObjectRef.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertListResponse.md b/src/rest/generated/docs/AlertListResponse.md new file mode 100644 index 0000000..7069efd --- /dev/null +++ b/src/rest/generated/docs/AlertListResponse.md @@ -0,0 +1,16 @@ + +# AlertListResponse + + +## Properties + +Name | Type +------------ | ------------- +`alerts` | [Array<AlertResource>](AlertResource.md) +`meta` | [Meta](Meta.md) +`facets` | [AlertFacets](AlertFacets.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertResolvedServiceBinding.md b/src/rest/generated/docs/AlertResolvedServiceBinding.md new file mode 100644 index 0000000..a7e6432 --- /dev/null +++ b/src/rest/generated/docs/AlertResolvedServiceBinding.md @@ -0,0 +1,17 @@ + +# AlertResolvedServiceBinding + +Fully-resolved service-binding triplet for an alert. Mirrors the GraphQL MonitorV2AlarmServiceBinding type. All three fields are non-empty when the object is populated; the field is omitted when no resolved triplet exists for the alert. + +## Properties + +Name | Type +------------ | ------------- +`serviceName` | string +`environment` | string +`serviceNamespace` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertResource.md b/src/rest/generated/docs/AlertResource.md new file mode 100644 index 0000000..e93b676 --- /dev/null +++ b/src/rest/generated/docs/AlertResource.md @@ -0,0 +1,29 @@ + +# AlertResource + +A monitor alert representing a detected condition. + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`start` | string +`end` | string +`detectedStart` | string +`detectedEnd` | string +`status` | [AlertStatus](AlertStatus.md) +`level` | [AlertLevel](AlertLevel.md) +`groupingHash` | string +`capturedValues` | [Array<AlertCapturedValue>](AlertCapturedValue.md) +`context` | [Array<AlertContextEntry>](AlertContextEntry.md) +`monitorVersion` | string +`monitor` | [MonitorRef](MonitorRef.md) +`muted` | boolean +`resolvedServiceBinding` | [AlertResolvedServiceBinding](AlertResolvedServiceBinding.md) +`stats` | [AlertActionStats](AlertActionStats.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/AlertStatus.md b/src/rest/generated/docs/AlertStatus.md new file mode 100644 index 0000000..3c5ff56 --- /dev/null +++ b/src/rest/generated/docs/AlertStatus.md @@ -0,0 +1,14 @@ + +# AlertStatus + +Current status of the alert + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ApiTokenCreateRequest.md b/src/rest/generated/docs/ApiTokenCreateRequest.md new file mode 100644 index 0000000..cab424c --- /dev/null +++ b/src/rest/generated/docs/ApiTokenCreateRequest.md @@ -0,0 +1,16 @@ + +# ApiTokenCreateRequest + + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`description` | string +`lifetimeHours` | number + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ApiTokenListResponse.md b/src/rest/generated/docs/ApiTokenListResponse.md new file mode 100644 index 0000000..50e6513 --- /dev/null +++ b/src/rest/generated/docs/ApiTokenListResponse.md @@ -0,0 +1,15 @@ + +# ApiTokenListResponse + + +## Properties + +Name | Type +------------ | ------------- +`apiTokens` | [Array<ApiTokenResource>](ApiTokenResource.md) +`meta` | [Meta](Meta.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ApiTokenResource.md b/src/rest/generated/docs/ApiTokenResource.md new file mode 100644 index 0000000..1c19e30 --- /dev/null +++ b/src/rest/generated/docs/ApiTokenResource.md @@ -0,0 +1,23 @@ + +# ApiTokenResource + + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`label` | string +`description` | string +`expiration` | string +`createdBy` | [User](User.md) +`createdAt` | string +`updatedBy` | [User](User.md) +`updatedAt` | string +`disabled` | boolean +`secret` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ApiTokenUpdateRequest.md b/src/rest/generated/docs/ApiTokenUpdateRequest.md new file mode 100644 index 0000000..1da747c --- /dev/null +++ b/src/rest/generated/docs/ApiTokenUpdateRequest.md @@ -0,0 +1,17 @@ + +# ApiTokenUpdateRequest + + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`description` | string +`lifetimeHours` | number +`disabled` | boolean + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetAccelerationError.md b/src/rest/generated/docs/DatasetAccelerationError.md new file mode 100644 index 0000000..ee0ca15 --- /dev/null +++ b/src/rest/generated/docs/DatasetAccelerationError.md @@ -0,0 +1,15 @@ + +# DatasetAccelerationError + + +## Properties + +Name | Type +------------ | ------------- +`time` | string +`errorText` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetAccelerationInfo.md b/src/rest/generated/docs/DatasetAccelerationInfo.md new file mode 100644 index 0000000..424f0b3 --- /dev/null +++ b/src/rest/generated/docs/DatasetAccelerationInfo.md @@ -0,0 +1,32 @@ + +# DatasetAccelerationInfo + + +## Properties + +Name | Type +------------ | ------------- +`state` | [DatasetAccelerationState](DatasetAccelerationState.md) +`stalenessSeconds` | number +`recentStalenessSeconds` | number +`stalenessReasons` | [Array<DatasetStalenessReason>](DatasetStalenessReason.md) +`userConfiguredTargetStalenessSeconds` | number +`targetExcludingDownstreamStalenessSeconds` | number +`effectiveTargetStalenessSeconds` | number +`rateLimitOverrideTargetStalenessSeconds` | number +`alwaysAccelerated` | boolean +`acceleratedRanges` | [Array<OpenTimeRange>](OpenTimeRange.md) +`targetAcceleratedRanges` | [Array<OpenTimeRange>](OpenTimeRange.md) +`freshnessTime` | string +`effectiveOnDemandMaterializationLengthDays` | number +`dataRetentionEnabled` | boolean +`effectiveDataRetentionPeriodDays` | number +`effectiveDataRetentionTimestamp` | string +`minimumDataTimestamp` | string +`hibernatedAt` | string +`errors` | [Array<DatasetAccelerationError>](DatasetAccelerationError.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetAccelerationState.md b/src/rest/generated/docs/DatasetAccelerationState.md new file mode 100644 index 0000000..e9ed30b --- /dev/null +++ b/src/rest/generated/docs/DatasetAccelerationState.md @@ -0,0 +1,14 @@ + +# DatasetAccelerationState + +The state of the dataset\'s acceleration. Initializing: The dataset is newly created/updated and acceleration has just started. Accelerated: The dataset is accelerated and available for querying. AcceleratedImmediately: The dataset is accelerated and available for querying. The dataset is also in \"live mode\", meaning it is being updated as fast as possible. Unavailable: The dataset is not accelerated and is not available for querying due to a compilation error in the dataset or upstream. Disabled: The dataset is not accelerated and is available for querying due to user disablement. (e.g. dataset is a view) Error: The dataset is not accelerated and may return outdated results due to a critical error. + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetAccelerationType.md b/src/rest/generated/docs/DatasetAccelerationType.md new file mode 100644 index 0000000..ddb3fa7 --- /dev/null +++ b/src/rest/generated/docs/DatasetAccelerationType.md @@ -0,0 +1,13 @@ + +# DatasetAccelerationType + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetApi.md b/src/rest/generated/docs/DatasetApi.md new file mode 100644 index 0000000..6a25f74 --- /dev/null +++ b/src/rest/generated/docs/DatasetApi.md @@ -0,0 +1,420 @@ +# DatasetApi + +All URIs are relative to *https://OBSERVE_CUSTOMERID.observeinc.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getDataset**](DatasetApi.md#getdataset) | **GET** /v1/datasets/{id} | Get a dataset | +| [**getDatasetGraph**](DatasetApi.md#getdatasetgraph) | **GET** /v1/datasets/{id}/graph | Get the lineage graph neighborhood around a focal dataset | +| [**getDatasetStats**](DatasetApi.md#getdatasetstats) | **GET** /v1/datasets/stats | Get dataset attribute statistics | +| [**listDatasetGraph**](DatasetApi.md#listdatasetgraph) | **GET** /v1/datasets/graph | Get the full dataset graph | +| [**listDatasets**](DatasetApi.md#listdatasets) | **GET** /v1/datasets | Get a list of datasets | + + + +## getDataset + +> DatasetResource getDataset(id, expand) + +Get a dataset + +> **Alpha:** This API may change without notice; not recommended > for production use. Returns a single dataset by ID. The response body is the same `Dataset-Resource` shape returned by the list endpoint. Set `expand=true` to inline reference fields (`createdBy`, `updatedBy`, `managedBy`, `defaultDashboard`, `defaultInstanceDashboard`, `storageIntegration.record`). Without `expand`, references contain only `id`. To look up a dataset by label or other attribute, use `GET /v1/datasets` with a CEL `filter`. + +### Example + +```ts +import { + Configuration, + DatasetApi, +} from ''; +import type { GetDatasetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new DatasetApi(config); + + const body = { + // string | The id of the dataset to query + id: 1, + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + } satisfies GetDatasetRequest; + + try { + const data = await api.getDataset(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | The id of the dataset to query | [Defaults to `undefined`] | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | + +### Return type + +[**DatasetResource**](DatasetResource.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Dataset queried successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getDatasetGraph + +> DatasetGraphResponse getDatasetGraph(id, limit) + +Get the lineage graph neighborhood around a focal dataset + +> **Alpha:** This API may change without notice; not recommended > for production use. Returns the BFS-nearest lineage neighborhood around the focal dataset id, walking transform data-input edges (`InputRole=Data`) in both directions over the default-filtered dataset set (excludes monitors and metric SMA datasets). The response uses the same `Dataset-GraphResponse` shape as `GET /v1/datasets/graph`. Lineage view semantics: foreign-key edges are **not** traversed by this endpoint — they are surfaced by the full-graph endpoint for the Link/Explore-Universe views. Reference-role transform inputs are also excluded. Ordering within the response is BFS order: focal dataset first, then by BFS depth, ties broken by `id` ascending. If the walk exceeds `limit`, the response is truncated to the nearest `limit` nodes and `meta.totalCount` is set to `-1`. CEL `filter` and `expand` are not supported. + +### Example + +```ts +import { + Configuration, + DatasetApi, +} from ''; +import type { GetDatasetGraphRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new DatasetApi(config); + + const body = { + // string | Focal dataset id. + id: 41000234, + // number | Max number of nodes (including the focal) in the returned neighborhood. Default 500, max 5000. When the BFS hits this cap, meta.totalCount is -1. (optional) + limit: 789, + } satisfies GetDatasetGraphRequest; + + try { + const data = await api.getDatasetGraph(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Focal dataset id. | [Defaults to `undefined`] | +| **limit** | `number` | Max number of nodes (including the focal) in the returned neighborhood. Default 500, max 5000. When the BFS hits this cap, meta.totalCount is -1. | [Optional] [Defaults to `500`] | + +### Return type + +[**DatasetGraphResponse**](DatasetGraphResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Lineage neighborhood retrieved successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getDatasetStats + +> DatasetStatsResponse getDatasetStats(topK, filter, attributes, multiValueAttributes) + +Get dataset attribute statistics + +> **Alpha:** This API may change without notice; not recommended > for production use. Returns aggregated statistics — distinct value count and the top-K most frequent value/count pairs — for one or more dataset attributes, optionally restricted to a CEL-filtered subset of datasets. Each `attributes` entry is a CEL expression that produces a comparable value (string, int, bool, timestamp); compound expressions are allowed (`coalesce(_package, label)`). The CEL environment matches `GET /v1/datasets`; see that endpoint\'s description for the field mapping, type discrepancies, and available functions. Each `multiValueAttributes` entry is a CEL expression that produces a `list<comparable>`; the list is flattened across all matching datasets and counted as **total occurrences**, so a single dataset whose expression evaluates to a 3-element list contributes 3 increments. `multiValueAttributes` `count` values may therefore exceed `meta.filteredDatasets`. For `attributes` the count is unchanged: the number of *datasets* with that value. At least one of `attributes` or `multiValueAttributes` must be non-empty; passing neither returns 400. Stat values are returned as JSON strings regardless of the expression\'s CEL type: - `string` — verbatim. - `int` — decimal digits (e.g. `\"41000234\"`). - `bool` — `\"true\"` or `\"false\"`. - `timestamp` — RFC 3339 (e.g. `\"2024-01-01T00:00:00Z\"`). The response `meta` block reports `totalDatasets` (before the filter) and `filteredDatasets` (after) so callers can compute coverage. + +### Example + +```ts +import { + Configuration, + DatasetApi, +} from ''; +import type { GetDatasetStatsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new DatasetApi(config); + + const body = { + // number | Number of top values to return per attribute, sorted by count descending. Range 1–100. The total distinct count for each attribute is always reported via `distinctCount`, even when it exceeds `topK`. + topK: 789, + // string | CEL expression restricting which datasets contribute to the statistics. Must evaluate to `bool`. Must be URL-encoded. If omitted, statistics are computed across all readable datasets. See `GET /v1/datasets` for the CEL primer and filter examples. (optional) + filter: filter_example, + // string | CSV list of CEL expressions, each producing a comparable value (string, int, bool, timestamp). Each expression identifies one stat to compute over the filtered dataset set. Maximum 10 expressions per request. See the operation description for the wire format of stat values. Either `attributes` or `multiValueAttributes` must be non-empty; both may be supplied together. CSV-escape first, then URL-encode. Wrap an item in `\"` if it contains a comma or `\"`; double a literal `\"` to `\"\"` inside a quoted item. (optional) + attributes: attributes_example, + // string | CSV list of CEL expressions, each producing a `list` (e.g. `interfaces.map(i, i.path)`, `correlationTags.map(t, t.tag)`, `primaryKey`, `fieldList.map(f, f.name)`). For each matching dataset, the expression\'s list is flattened into a per-expression bag and counts are total occurrences — a single dataset contributes one increment per element. The flattened bag for each expression is capped at 10,000 values across all matching datasets; exceeding the cap returns 400. Maximum 10 expressions. Either `attributes` or `multiValueAttributes` must be non-empty; both may be supplied together. `topK` applies independently to each entry of either array. CSV-escape first, then URL-encode. Wrap an item in `\"` if it contains a comma or `\"`; double a literal `\"` to `\"\"` inside a quoted item. (optional) + multiValueAttributes: multiValueAttributes_example, + } satisfies GetDatasetStatsRequest; + + try { + const data = await api.getDatasetStats(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **topK** | `number` | Number of top values to return per attribute, sorted by count descending. Range 1–100. The total distinct count for each attribute is always reported via `distinctCount`, even when it exceeds `topK`. | [Defaults to `undefined`] | +| **filter** | `string` | CEL expression restricting which datasets contribute to the statistics. Must evaluate to `bool`. Must be URL-encoded. If omitted, statistics are computed across all readable datasets. See `GET /v1/datasets` for the CEL primer and filter examples. | [Optional] [Defaults to `undefined`] | +| **attributes** | `string` | CSV list of CEL expressions, each producing a comparable value (string, int, bool, timestamp). Each expression identifies one stat to compute over the filtered dataset set. Maximum 10 expressions per request. See the operation description for the wire format of stat values. Either `attributes` or `multiValueAttributes` must be non-empty; both may be supplied together. CSV-escape first, then URL-encode. Wrap an item in `\"` if it contains a comma or `\"`; double a literal `\"` to `\"\"` inside a quoted item. | [Optional] [Defaults to `undefined`] | +| **multiValueAttributes** | `string` | CSV list of CEL expressions, each producing a `list<comparable>` (e.g. `interfaces.map(i, i.path)`, `correlationTags.map(t, t.tag)`, `primaryKey`, `fieldList.map(f, f.name)`). For each matching dataset, the expression\'s list is flattened into a per-expression bag and counts are total occurrences — a single dataset contributes one increment per element. The flattened bag for each expression is capped at 10,000 values across all matching datasets; exceeding the cap returns 400. Maximum 10 expressions. Either `attributes` or `multiValueAttributes` must be non-empty; both may be supplied together. `topK` applies independently to each entry of either array. CSV-escape first, then URL-encode. Wrap an item in `\"` if it contains a comma or `\"`; double a literal `\"` to `\"\"` inside a quoted item. | [Optional] [Defaults to `undefined`] | + +### Return type + +[**DatasetStatsResponse**](DatasetStatsResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Dataset statistics retrieved successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listDatasetGraph + +> DatasetGraphResponse listDatasetGraph() + +Get the full dataset graph + +> **Alpha:** This API may change without notice; not recommended > for production use. Returns a lean per-dataset projection — `Dataset-GraphSummary` — for every dataset visible in the environment, plus the foreign-key and transform-input edges between them. Sorted by `id` ascending. Designed to feed the Explore Universe graph in a single call. Intentionally unpaginated and intentionally unfiltered: this endpoint applies a fixed default filter that excludes monitors (`isMonitor`) and metric SMA datasets (`isMetricSMA`), and does not accept a CEL `filter` or `expand`. Always returns 200 with `meta.totalCount` equal to the number of returned datasets; the `-1` sentinel is not used here. Callers that need to defend against very large environments should cap on the client side. For arbitrary filtering or pagination, use `GET /v1/datasets` instead. For the lineage neighborhood around a single dataset, use `GET /v1/datasets/{id}/graph`. + +### Example + +```ts +import { + Configuration, + DatasetApi, +} from ''; +import type { ListDatasetGraphRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new DatasetApi(config); + + try { + const data = await api.listDatasetGraph(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**DatasetGraphResponse**](DatasetGraphResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Graph retrieved successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listDatasets + +> DatasetListResponse listDatasets(filter, orderBy, offset, limit, expand, query, minScore) + +Get a list of datasets + +> **Alpha:** This API may change without notice; not recommended > for production use. Returns a paginated list of datasets the caller has read access to, optionally filtered and ordered with a CEL expression. Default page size is 50; maximum is 100. Default ordering is by `id` ascending. Set `expand=true` to inline reference fields (`createdBy`, `managedBy`, `storageIntegration.record`, …). Without `expand`, references contain only `id`. ## Filtering and ordering with CEL The `filter` and `orderBy` query parameters are evaluated as [Common Expression Language (CEL)](https://cel.dev) expressions against a stable schema that mirrors the dataset response body. `filter` must evaluate to `bool`; `orderBy` is a CSV list of CEL expressions whose values must be comparable. URL-encode both; CSV-escape `orderBy` items first (see the `orderBy` parameter for syntax). Expressions that reference unknown fields, use the wrong type, or exceed the server-side cost limit return 400. ### CEL → REST field mapping With the exceptions noted below, every CEL field name matches the JSON key on `Dataset-Resource` 1‑to‑1, and CEL types map to JSON wire types as follows: | CEL type | JSON wire type | | ------------------- | ------------------------------------------------ | | `string`, `string?` | string (or `null` when nullable) | | `bool` | boolean | | `int` | integer | | `timestamp` | RFC 3339 string (e.g. `createdAt`, `updatedAt`) | | `list(T)` | array | | `map(K, V)` | object | | Wrapper types | nested object with the same sub-field names | Every `id` field — top-level and nested — is `int` in CEL but rendered as `string` in JSON (int64 values may overflow the JS number range). Compare with an integer literal in CEL: `id == 41000234`, not `id == \"41000234\"`. ### Discrepancies between CEL and REST | Field | CEL | REST | Notes | | ------------------------------ | ---------------------------------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | `_name`, `_package` | `string`, derived from `label` | not present | CEL-only convenience fields. `label = \"Logs/AWS/CloudTrail\"` ⇒ `_package = \"Logs/AWS/\"`, `_name = \"CloudTrail\"`. | | `createdAt`, `updatedAt` | `timestamp` | RFC 3339 string | In CEL, compare with `timestamp(\"2024-01-01T00:00:00Z\")` or use `now() - duration(\"24h\")`. | | `storageIntegration.record.*` | always loadable for filter evaluation | only present when `expand=true` | A filter like `storageIntegration.record.label == \"snowflake-prod\"` works on every request; the `record` object is only echoed back in the response when `expand=true`. | ### Available CEL functions The dataset CEL environment registers the [CEL standard definitions](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/cel#StdLib) (operators, `in`, `?:`, `size()`, `string.contains`, `string.startsWith`, `string.endsWith`, `matches`, etc.) plus the following extension libraries from [cel-go v0.28.0](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext): - [`ext.Strings`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Strings) — `charAt`, `indexOf`, `join`, `lowerAscii`, `replace`, `split`, `substring`, `trim`, `upperAscii`, `format` - [`ext.Lists`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Lists) — `lists.flatten`, `lists.range`, `lists.slice` - [`ext.Math`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Math) — `math.greatest`, `math.least` - [`ext.Sets`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Sets) — `sets.contains`, `sets.equivalent`, `sets.intersects` - [`ext.Regex`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Regex) — `re.capture`, `re.extract` - [`ext.Encoders`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Encoders) — `base64.encode`, `base64.decode` - [`ext.Bindings`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Bindings) — `cel.bind` for let-binding sub-expressions - [`ext.Protos`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/ext#Protos) — protobuf helpers - [`cel.OptionalTypes`](https://pkg.go.dev/github.com/google/cel-go@v0.28.0/cel#OptionalTypes) — `optional.of`, `optional.ofNonZero`, `optional.none` See `Dataset-Resource` below for the full set of fields and types. ## Semantic search Pass `query` to find datasets by meaning rather than by exact field values. Results are ranked by relevance descending; `orderBy` is ignored when `query` is set. `meta.totalCount` is always `-1` for semantic-search requests because the full match count cannot be computed efficiently. `filter` may be combined with `query` to narrow results after ranking. When both are set, the response may contain fewer than `limit` items if many ranked candidates are filtered out. Returns 404 if semantic search is not available in this deployment. + +### Example + +```ts +import { + Configuration, + DatasetApi, +} from ''; +import type { ListDatasetsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new DatasetApi(config); + + const body = { + // string | CEL expression that response datasets must match. Must evaluate to `bool`. Must be URL-encoded. See the operation description for the CEL primer (field mapping, type discrepancies, available functions). ## CEL functions ### `hasCorrelationTag(tag string, value string) bool` Returns `true` if this dataset has ever been associated with the correlation tag key-value pair `tag=value`. Both arguments must be constant string literals. Field references, `cel.bind` names, and function calls are rejected with HTTP 400. Error conditions: - HTTP 400 if a `(tag, value)` pair matches more than 10,000 datasets. Narrow the tag name or value to reduce the match set. - HTTP 400 if this feature is not available for your account. Contact support to enable correlation-tag filtering. - HTTP 503 if the tag index is temporarily unavailable. Retry after a short interval. (optional) + filter: label == "Source" || id in [40000123, 40000456], + // string | CSV list of CEL expressions, each producing a comparable value. Prefix an item with `-` for descending order. Default sort is `id` ascending; pagination is stable as long as no datasets are created or deleted between requests. CSV-escape first, then URL-encode. Wrap an item in `\"` if it contains a comma or `\"`; double a literal `\"` to `\"\"` inside a quoted item. **Ignored when `query` is set** — results are ordered by relevance when semantic search is active (see the Semantic search section in the operation description). (optional) + orderBy: "coalesce(managedBy.label, label)",-id, + // number | Number of items to skip before starting to collect the result set (optional) + offset: 789, + // number | Maximum number of items to return in the response (optional) + limit: 789, + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + // string | Free-text search query. When set, returns datasets ranked by relevance to the query, with the most relevant results first. `orderBy` is ignored — results are always ordered by relevance descending. May be combined with `filter` to narrow results after ranking, and with `limit`/`offset` for pagination. When `filter` is also set, the response may contain fewer than `limit` items if many ranked candidates are filtered out. `meta.totalCount` is always `-1` for semantic-search requests. Returns 404 if semantic search is not available in this deployment. (optional) + query: customer purchase orders, + // number | Minimum cosine similarity score (0.0–1.0) for semantic search results. Datasets scoring below this threshold are excluded. Only applies when `query` is set. Defaults to 0.3. (optional) + minScore: 1.2, + } satisfies ListDatasetsRequest; + + try { + const data = await api.listDatasets(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **filter** | `string` | CEL expression that response datasets must match. Must evaluate to `bool`. Must be URL-encoded. See the operation description for the CEL primer (field mapping, type discrepancies, available functions). ## CEL functions ### `hasCorrelationTag(tag string, value string) bool` Returns `true` if this dataset has ever been associated with the correlation tag key-value pair `tag=value`. Both arguments must be constant string literals. Field references, `cel.bind` names, and function calls are rejected with HTTP 400. Error conditions: - HTTP 400 if a `(tag, value)` pair matches more than 10,000 datasets. Narrow the tag name or value to reduce the match set. - HTTP 400 if this feature is not available for your account. Contact support to enable correlation-tag filtering. - HTTP 503 if the tag index is temporarily unavailable. Retry after a short interval. | [Optional] [Defaults to `undefined`] | +| **orderBy** | `string` | CSV list of CEL expressions, each producing a comparable value. Prefix an item with `-` for descending order. Default sort is `id` ascending; pagination is stable as long as no datasets are created or deleted between requests. CSV-escape first, then URL-encode. Wrap an item in `\"` if it contains a comma or `\"`; double a literal `\"` to `\"\"` inside a quoted item. **Ignored when `query` is set** — results are ordered by relevance when semantic search is active (see the Semantic search section in the operation description). | [Optional] [Defaults to `undefined`] | +| **offset** | `number` | Number of items to skip before starting to collect the result set | [Optional] [Defaults to `undefined`] | +| **limit** | `number` | Maximum number of items to return in the response | [Optional] [Defaults to `undefined`] | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | +| **query** | `string` | Free-text search query. When set, returns datasets ranked by relevance to the query, with the most relevant results first. `orderBy` is ignored — results are always ordered by relevance descending. May be combined with `filter` to narrow results after ranking, and with `limit`/`offset` for pagination. When `filter` is also set, the response may contain fewer than `limit` items if many ranked candidates are filtered out. `meta.totalCount` is always `-1` for semantic-search requests. Returns 404 if semantic search is not available in this deployment. | [Optional] [Defaults to `undefined`] | +| **minScore** | `number` | Minimum cosine similarity score (0.0–1.0) for semantic search results. Datasets scoring below this threshold are excluded. Only applies when `query` is set. Defaults to 0.3. | [Optional] [Defaults to `0.3`] | + +### Return type + +[**DatasetListResponse**](DatasetListResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Datasets queried successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/src/rest/generated/docs/DatasetAttributeStats.md b/src/rest/generated/docs/DatasetAttributeStats.md new file mode 100644 index 0000000..d33bfc6 --- /dev/null +++ b/src/rest/generated/docs/DatasetAttributeStats.md @@ -0,0 +1,16 @@ + +# DatasetAttributeStats + + +## Properties + +Name | Type +------------ | ------------- +`attribute` | string +`distinctCount` | number +`stats` | [Array<DatasetStatValueCount>](DatasetStatValueCount.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetBrief.md b/src/rest/generated/docs/DatasetBrief.md new file mode 100644 index 0000000..a81706d --- /dev/null +++ b/src/rest/generated/docs/DatasetBrief.md @@ -0,0 +1,18 @@ + +# DatasetBrief + +Brief record fields for a DatasetRef (label, description, iconUrl, contentType). Field naming mirrors ObjectBrief in this same file (iconUrl, not icon) for consistency across reference-brief pairs. + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`description` | string +`iconUrl` | string +`contentType` | [DatasetContentType](DatasetContentType.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetCompilationError.md b/src/rest/generated/docs/DatasetCompilationError.md new file mode 100644 index 0000000..14e4945 --- /dev/null +++ b/src/rest/generated/docs/DatasetCompilationError.md @@ -0,0 +1,15 @@ + +# DatasetCompilationError + + +## Properties + +Name | Type +------------ | ------------- +`error` | string +`errorInDataset` | [DatasetRef](DatasetRef.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetContentType.md b/src/rest/generated/docs/DatasetContentType.md new file mode 100644 index 0000000..adbf356 --- /dev/null +++ b/src/rest/generated/docs/DatasetContentType.md @@ -0,0 +1,14 @@ + +# DatasetContentType + +The type of data a dataset contains. For Resource datasets, this is determined by the dataset kind. For other kinds, it is derived from the dataset\'s interface bindings. Returns Unknown if no recognized interface is found. + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetCorrelationTag.md b/src/rest/generated/docs/DatasetCorrelationTag.md new file mode 100644 index 0000000..9794ac9 --- /dev/null +++ b/src/rest/generated/docs/DatasetCorrelationTag.md @@ -0,0 +1,15 @@ + +# DatasetCorrelationTag + + +## Properties + +Name | Type +------------ | ------------- +`tag` | string +`path` | [DatasetFieldPath](DatasetFieldPath.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetDataType.md b/src/rest/generated/docs/DatasetDataType.md new file mode 100644 index 0000000..75679d3 --- /dev/null +++ b/src/rest/generated/docs/DatasetDataType.md @@ -0,0 +1,13 @@ + +# DatasetDataType + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetDatasetKind.md b/src/rest/generated/docs/DatasetDatasetKind.md new file mode 100644 index 0000000..5f9192c --- /dev/null +++ b/src/rest/generated/docs/DatasetDatasetKind.md @@ -0,0 +1,13 @@ + +# DatasetDatasetKind + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetDefinitionType.md b/src/rest/generated/docs/DatasetDefinitionType.md new file mode 100644 index 0000000..69fac89 --- /dev/null +++ b/src/rest/generated/docs/DatasetDefinitionType.md @@ -0,0 +1,14 @@ + +# DatasetDefinitionType + +The kind of dataset definition. Values match `metatypes.TransformKind`\'s string constants verbatim where the backend has one (`OPAL`, `Builtin`, `LogDerived`); `Source` and `Invalid` are REST-side additions for dataset shapes the backend does not surface as a TransformKind. - OPAL: dataset is produced by an OPAL transform pipeline. - Builtin: dataset is produced by a built-in transform (e.g. canonical-trace). - LogDerived: dataset is a log-derived metric. - Source: dataset receives data directly (datastream or external table); it has no transform. - Invalid: the stored transform kind is empty or unrecognised. Indicates corrupt or partially-migrated data, or a legacy SQL-kind transform (no production datasets carry one as of 2026-05-14). + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetFieldDesc.md b/src/rest/generated/docs/DatasetFieldDesc.md new file mode 100644 index 0000000..6d9ec09 --- /dev/null +++ b/src/rest/generated/docs/DatasetFieldDesc.md @@ -0,0 +1,22 @@ + +# DatasetFieldDesc + + +## Properties + +Name | Type +------------ | ------------- +`name` | string +`type` | [DatasetFieldType](DatasetFieldType.md) +`indexDefs` | [Array<DatasetIndexDefinition>](DatasetIndexDefinition.md) +`linkDesc` | [DatasetForeignKey](DatasetForeignKey.md) +`isEnum` | boolean +`isSearchable` | boolean +`isHidden` | boolean +`isConst` | boolean +`isMetric` | boolean + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetFieldPath.md b/src/rest/generated/docs/DatasetFieldPath.md new file mode 100644 index 0000000..e17fe93 --- /dev/null +++ b/src/rest/generated/docs/DatasetFieldPath.md @@ -0,0 +1,15 @@ + +# DatasetFieldPath + + +## Properties + +Name | Type +------------ | ------------- +`field` | string +`path` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetFieldType.md b/src/rest/generated/docs/DatasetFieldType.md new file mode 100644 index 0000000..8fb5ebf --- /dev/null +++ b/src/rest/generated/docs/DatasetFieldType.md @@ -0,0 +1,14 @@ + +# DatasetFieldType + + +## Properties + +Name | Type +------------ | ------------- +`tag` | [DatasetDataType](DatasetDataType.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetForeignKey.md b/src/rest/generated/docs/DatasetForeignKey.md new file mode 100644 index 0000000..286582d --- /dev/null +++ b/src/rest/generated/docs/DatasetForeignKey.md @@ -0,0 +1,19 @@ + +# DatasetForeignKey + + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`targetDataset` | [DatasetRef](DatasetRef.md) +`targetStageLabel` | string +`targetLabelField` | string +`srcPaths` | [Array<DatasetFieldPath>](DatasetFieldPath.md) +`dstFields` | Array<string> + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetGraphResponse.md b/src/rest/generated/docs/DatasetGraphResponse.md new file mode 100644 index 0000000..23e37c6 --- /dev/null +++ b/src/rest/generated/docs/DatasetGraphResponse.md @@ -0,0 +1,16 @@ + +# DatasetGraphResponse + +Response body for both GET /v1/datasets/graph and GET /v1/datasets/{id}/graph. On the full-graph endpoint: datasets are sorted by id ascending, and meta.totalCount is always the number of returned datasets (never -1). On the focal endpoint: datasets are sorted in BFS-nearest order (focal first, then by BFS depth, ties broken by id ascending for determinism), and meta.totalCount is -1 iff the BFS was capped by limit; otherwise it is the number of returned datasets. + +## Properties + +Name | Type +------------ | ------------- +`datasets` | [Array<DatasetGraphSummary>](DatasetGraphSummary.md) +`meta` | [Meta](Meta.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetGraphSummary.md b/src/rest/generated/docs/DatasetGraphSummary.md new file mode 100644 index 0000000..fce9a49 --- /dev/null +++ b/src/rest/generated/docs/DatasetGraphSummary.md @@ -0,0 +1,23 @@ + +# DatasetGraphSummary + +Lean per-dataset projection used to render the Dataset Graph, Lineage tab, and Explore Universe views. Intentionally a strict subset of Dataset-Resource: only the fields required to render a graph node and its outgoing edges. expand is not supported on graph endpoints. NOTE: foreignKeyTargetIds and inputDatasetIds are returned as flat arrays of id strings rather than the nested reference shape used elsewhere in this API. This is a deliberate divergence from the REST Style Guide accepted for payload size on the full-graph endpoint; these fields are not expandable. + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`label` | string +`kind` | [DatasetDatasetKind](DatasetDatasetKind.md) +`contentType` | [DatasetContentType](DatasetContentType.md) +`icon` | string +`compilationError` | [DatasetCompilationError](DatasetCompilationError.md) +`accelerationState` | [DatasetAccelerationState](DatasetAccelerationState.md) +`foreignKeyTargetIds` | Array<string> +`inputDatasetIds` | Array<string> + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetGroupingElement.md b/src/rest/generated/docs/DatasetGroupingElement.md new file mode 100644 index 0000000..b151a9a --- /dev/null +++ b/src/rest/generated/docs/DatasetGroupingElement.md @@ -0,0 +1,15 @@ + +# DatasetGroupingElement + + +## Properties + +Name | Type +------------ | ------------- +`type` | [DatasetGroupingElementType](DatasetGroupingElementType.md) +`value` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetGroupingElementType.md b/src/rest/generated/docs/DatasetGroupingElementType.md new file mode 100644 index 0000000..a5c5c0b --- /dev/null +++ b/src/rest/generated/docs/DatasetGroupingElementType.md @@ -0,0 +1,13 @@ + +# DatasetGroupingElementType + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetGroupingKey.md b/src/rest/generated/docs/DatasetGroupingKey.md new file mode 100644 index 0000000..871a1f4 --- /dev/null +++ b/src/rest/generated/docs/DatasetGroupingKey.md @@ -0,0 +1,14 @@ + +# DatasetGroupingKey + + +## Properties + +Name | Type +------------ | ------------- +`elements` | [Array<DatasetGroupingElement>](DatasetGroupingElement.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetImplementedInterface.md b/src/rest/generated/docs/DatasetImplementedInterface.md new file mode 100644 index 0000000..ecd08e9 --- /dev/null +++ b/src/rest/generated/docs/DatasetImplementedInterface.md @@ -0,0 +1,15 @@ + +# DatasetImplementedInterface + + +## Properties + +Name | Type +------------ | ------------- +`path` | string +`mapping` | [Array<DatasetInterfaceFieldMapping>](DatasetInterfaceFieldMapping.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetIndexDefinition.md b/src/rest/generated/docs/DatasetIndexDefinition.md new file mode 100644 index 0000000..92cb9c5 --- /dev/null +++ b/src/rest/generated/docs/DatasetIndexDefinition.md @@ -0,0 +1,15 @@ + +# DatasetIndexDefinition + + +## Properties + +Name | Type +------------ | ------------- +`field` | string +`type` | [DatasetIndexType](DatasetIndexType.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetIndexType.md b/src/rest/generated/docs/DatasetIndexType.md new file mode 100644 index 0000000..1bcc0b2 --- /dev/null +++ b/src/rest/generated/docs/DatasetIndexType.md @@ -0,0 +1,13 @@ + +# DatasetIndexType + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetInterfaceFieldMapping.md b/src/rest/generated/docs/DatasetInterfaceFieldMapping.md new file mode 100644 index 0000000..3db4326 --- /dev/null +++ b/src/rest/generated/docs/DatasetInterfaceFieldMapping.md @@ -0,0 +1,15 @@ + +# DatasetInterfaceFieldMapping + + +## Properties + +Name | Type +------------ | ------------- +`interfaceField` | string +`field` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetLegacyApi.md b/src/rest/generated/docs/DatasetLegacyApi.md new file mode 100644 index 0000000..2fcdc45 --- /dev/null +++ b/src/rest/generated/docs/DatasetLegacyApi.md @@ -0,0 +1,166 @@ +# DatasetLegacyApi + +All URIs are relative to *https://OBSERVE_CUSTOMERID.observeinc.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getDatasetById**](DatasetLegacyApi.md#getdatasetbyid) | **GET** /v1/dataset/{id} | Get a dataset (legacy) | +| [**listDatasets**](DatasetLegacyApi.md#listdatasets) | **GET** /v1/dataset | List datasets (legacy) | + + + +## getDatasetById + +> GetDatasetById200Response getDatasetById(id) + +Get a dataset (legacy) + +Get information about one dataset by id. Does not query the data inside the dataset. + +### Example + +```ts +import { + Configuration, + DatasetLegacyApi, +} from ''; +import type { GetDatasetByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new DatasetLegacyApi(config); + + const body = { + // string | The dataset id. Can be an ORN or a plain ID. + id: 40000068, + } satisfies GetDatasetByIdRequest; + + try { + const data = await api.getDatasetById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | The dataset id. Can be an ORN or a plain ID. | [Defaults to `undefined`] | + +### Return type + +[**GetDatasetById200Response**](GetDatasetById200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | ## Properties of one dataset Dataset properties, encoded as a JSON object. | - | +| **400** | Invalid request. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listDatasets + +> ListDatasetsResponse listDatasets(workspaceId, match, name, type, _interface) + +List datasets (legacy) + +List datasets, optionally matching: * Name substring * Workspace ID * Dataset type * Interface binding + +### Example + +```ts +import { + Configuration, + DatasetLegacyApi, +} from ''; +import type { ListDatasetsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new DatasetLegacyApi(config); + + const body = { + // number | Only include datasets in this workspace. (optional) + workspaceId: 41000011, + // string | Alphanumeric fuzzy match the name of the dataset. (optional) + match: logs, + // string | exact name of the dataset to match (optional) + name: kubernetes/Container Logs, + // string | Only include datasets of this type. (optional) + type: Event, + // string | Only include datasets that implement this interface. (optional) + _interface: metric, + } satisfies ListDatasetsRequest; + + try { + const data = await api.listDatasets(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspaceId** | `number` | Only include datasets in this workspace. | [Optional] [Defaults to `undefined`] | +| **match** | `string` | Alphanumeric fuzzy match the name of the dataset. | [Optional] [Defaults to `undefined`] | +| **name** | `string` | exact name of the dataset to match | [Optional] [Defaults to `undefined`] | +| **type** | `string` | Only include datasets of this type. | [Optional] [Defaults to `undefined`] | +| **_interface** | `string` | Only include datasets that implement this interface. | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ListDatasetsResponse**](ListDatasetsResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | ## A list of datasets The list is a JSON array of objects, each object representing a dataset. | - | +| **400** | Invalid request. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/src/rest/generated/docs/DatasetLegacyResource.md b/src/rest/generated/docs/DatasetLegacyResource.md new file mode 100644 index 0000000..5256919 --- /dev/null +++ b/src/rest/generated/docs/DatasetLegacyResource.md @@ -0,0 +1,16 @@ + +# DatasetLegacyResource + + +## Properties + +Name | Type +------------ | ------------- +`meta` | [DatasetLegacyResourceMeta](DatasetLegacyResourceMeta.md) +`config` | [DatasetLegacyResourceConfig](DatasetLegacyResourceConfig.md) +`state` | [DatasetLegacyResourceState](DatasetLegacyResourceState.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetLegacyResourceConfig.md b/src/rest/generated/docs/DatasetLegacyResourceConfig.md new file mode 100644 index 0000000..36ccc4c --- /dev/null +++ b/src/rest/generated/docs/DatasetLegacyResourceConfig.md @@ -0,0 +1,15 @@ + +# DatasetLegacyResourceConfig + +Directly settable properties of the dataset. + +## Properties + +Name | Type +------------ | ------------- +`name` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetLegacyResourceMeta.md b/src/rest/generated/docs/DatasetLegacyResourceMeta.md new file mode 100644 index 0000000..c3ae7fa --- /dev/null +++ b/src/rest/generated/docs/DatasetLegacyResourceMeta.md @@ -0,0 +1,17 @@ + +# DatasetLegacyResourceMeta + +Metadata about the dataset. + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`workspaceId` | string +`customerId` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetLegacyResourceState.md b/src/rest/generated/docs/DatasetLegacyResourceState.md new file mode 100644 index 0000000..9a41865 --- /dev/null +++ b/src/rest/generated/docs/DatasetLegacyResourceState.md @@ -0,0 +1,22 @@ + +# DatasetLegacyResourceState + +Implicitly derived state of the dataset. + +## Properties + +Name | Type +------------ | ------------- +`urlPath` | string +`kind` | string +`createdBy` | string +`createdDate` | string +`updatedBy` | string +`updatedDate` | string +`columns` | [Array<DatasetLegacyResourceStateColumnsInner>](DatasetLegacyResourceStateColumnsInner.md) +`interfaces` | [Array<DatasetLegacyResourceStateInterfacesInner>](DatasetLegacyResourceStateInterfacesInner.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetLegacyResourceStateColumnsInner.md b/src/rest/generated/docs/DatasetLegacyResourceStateColumnsInner.md new file mode 100644 index 0000000..b3490e5 --- /dev/null +++ b/src/rest/generated/docs/DatasetLegacyResourceStateColumnsInner.md @@ -0,0 +1,15 @@ + +# DatasetLegacyResourceStateColumnsInner + + +## Properties + +Name | Type +------------ | ------------- +`name` | string +`type` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetLegacyResourceStateInterfacesInner.md b/src/rest/generated/docs/DatasetLegacyResourceStateInterfacesInner.md new file mode 100644 index 0000000..8691cca --- /dev/null +++ b/src/rest/generated/docs/DatasetLegacyResourceStateInterfacesInner.md @@ -0,0 +1,15 @@ + +# DatasetLegacyResourceStateInterfacesInner + + +## Properties + +Name | Type +------------ | ------------- +`path` | string +`mapping` | Array<object> + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetListResponse.md b/src/rest/generated/docs/DatasetListResponse.md new file mode 100644 index 0000000..f7e02e4 --- /dev/null +++ b/src/rest/generated/docs/DatasetListResponse.md @@ -0,0 +1,15 @@ + +# DatasetListResponse + + +## Properties + +Name | Type +------------ | ------------- +`datasets` | [Array<DatasetResource>](DatasetResource.md) +`meta` | [Meta](Meta.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetQueryFilterApi.md b/src/rest/generated/docs/DatasetQueryFilterApi.md new file mode 100644 index 0000000..ded5d08 --- /dev/null +++ b/src/rest/generated/docs/DatasetQueryFilterApi.md @@ -0,0 +1,431 @@ +# DatasetQueryFilterApi + +All URIs are relative to *https://OBSERVE_CUSTOMERID.observeinc.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createDatasetQueryFilter**](DatasetQueryFilterApi.md#createdatasetqueryfilter) | **POST** /v1/datasets/{datasetId}/query-filters | Create a new dataset query filter | +| [**deleteDatasetQueryFilter**](DatasetQueryFilterApi.md#deletedatasetqueryfilter) | **DELETE** /v1/datasets/{datasetId}/query-filters/{id} | Delete a dataset query filter | +| [**getDatasetQueryFilterById**](DatasetQueryFilterApi.md#getdatasetqueryfilterbyid) | **GET** /v1/datasets/{datasetId}/query-filters/{id} | Get a dataset query filter by ID | +| [**listDatasetQueryFilters**](DatasetQueryFilterApi.md#listdatasetqueryfilters) | **GET** /v1/datasets/{datasetId}/query-filters | Get a list of dataset query filters | +| [**updateDatasetQueryFilter**](DatasetQueryFilterApi.md#updatedatasetqueryfilter) | **PATCH** /v1/datasets/{datasetId}/query-filters/{id} | Update a dataset query filter | + + + +## createDatasetQueryFilter + +> DatasetQueryFilterResource createDatasetQueryFilter(datasetId, datasetQueryFilterCreateRequest, expand) + +Create a new dataset query filter + +Create a new query filter for a specific dataset + +### Example + +```ts +import { + Configuration, + DatasetQueryFilterApi, +} from ''; +import type { CreateDatasetQueryFilterRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new DatasetQueryFilterApi(config); + + const body = { + // string | The ID of the dataset + datasetId: datasetId_example, + // DatasetQueryFilterCreateRequest + datasetQueryFilterCreateRequest: ..., + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + } satisfies CreateDatasetQueryFilterRequest; + + try { + const data = await api.createDatasetQueryFilter(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **datasetId** | `string` | The ID of the dataset | [Defaults to `undefined`] | +| **datasetQueryFilterCreateRequest** | [DatasetQueryFilterCreateRequest](DatasetQueryFilterCreateRequest.md) | | | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | + +### Return type + +[**DatasetQueryFilterResource**](DatasetQueryFilterResource.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Dataset query filter created successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteDatasetQueryFilter + +> deleteDatasetQueryFilter(datasetId, id) + +Delete a dataset query filter + +Delete an existing query filter + +### Example + +```ts +import { + Configuration, + DatasetQueryFilterApi, +} from ''; +import type { DeleteDatasetQueryFilterRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new DatasetQueryFilterApi(config); + + const body = { + // string | The ID of the dataset + datasetId: datasetId_example, + // string | The ID of the query filter to delete + id: 7890123, + } satisfies DeleteDatasetQueryFilterRequest; + + try { + const data = await api.deleteDatasetQueryFilter(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **datasetId** | `string` | The ID of the dataset | [Defaults to `undefined`] | +| **id** | `string` | The ID of the query filter to delete | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Dataset query filter deleted successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getDatasetQueryFilterById + +> DatasetQueryFilterResource getDatasetQueryFilterById(datasetId, id, expand) + +Get a dataset query filter by ID + +Retrieve a specific query filter by its ID + +### Example + +```ts +import { + Configuration, + DatasetQueryFilterApi, +} from ''; +import type { GetDatasetQueryFilterByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new DatasetQueryFilterApi(config); + + const body = { + // string | The ID of the dataset + datasetId: datasetId_example, + // string | The ID of the query filter to retrieve + id: 7890123, + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + } satisfies GetDatasetQueryFilterByIdRequest; + + try { + const data = await api.getDatasetQueryFilterById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **datasetId** | `string` | The ID of the dataset | [Defaults to `undefined`] | +| **id** | `string` | The ID of the query filter to retrieve | [Defaults to `undefined`] | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | + +### Return type + +[**DatasetQueryFilterResource**](DatasetQueryFilterResource.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Dataset query filter retrieved successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listDatasetQueryFilters + +> ListDatasetQueryFilters200Response listDatasetQueryFilters(datasetId, limit, offset, expand) + +Get a list of dataset query filters + +Get a list of all query filters for a specific dataset + +### Example + +```ts +import { + Configuration, + DatasetQueryFilterApi, +} from ''; +import type { ListDatasetQueryFiltersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new DatasetQueryFilterApi(config); + + const body = { + // string | The ID of the dataset + datasetId: datasetId_example, + // number | Maximum number of items to return in the response (optional) + limit: 789, + // number | Number of items to skip before starting to collect the result set (optional) + offset: 789, + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + } satisfies ListDatasetQueryFiltersRequest; + + try { + const data = await api.listDatasetQueryFilters(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **datasetId** | `string` | The ID of the dataset | [Defaults to `undefined`] | +| **limit** | `number` | Maximum number of items to return in the response | [Optional] [Defaults to `undefined`] | +| **offset** | `number` | Number of items to skip before starting to collect the result set | [Optional] [Defaults to `undefined`] | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ListDatasetQueryFilters200Response**](ListDatasetQueryFilters200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Dataset query filters retrieved successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateDatasetQueryFilter + +> DatasetQueryFilterResource updateDatasetQueryFilter(datasetId, id, datasetQueryFilterUpdateRequest, expand) + +Update a dataset query filter + +Update an existing query filter using JSON Merge Patch semantics + +### Example + +```ts +import { + Configuration, + DatasetQueryFilterApi, +} from ''; +import type { UpdateDatasetQueryFilterRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new DatasetQueryFilterApi(config); + + const body = { + // string | The ID of the dataset + datasetId: datasetId_example, + // string | The ID of the query filter to update + id: 7890123, + // DatasetQueryFilterUpdateRequest + datasetQueryFilterUpdateRequest: ..., + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + } satisfies UpdateDatasetQueryFilterRequest; + + try { + const data = await api.updateDatasetQueryFilter(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **datasetId** | `string` | The ID of the dataset | [Defaults to `undefined`] | +| **id** | `string` | The ID of the query filter to update | [Defaults to `undefined`] | +| **datasetQueryFilterUpdateRequest** | [DatasetQueryFilterUpdateRequest](DatasetQueryFilterUpdateRequest.md) | | | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | + +### Return type + +[**DatasetQueryFilterResource**](DatasetQueryFilterResource.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Dataset query filter updated successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/src/rest/generated/docs/DatasetQueryFilterCreateRequest.md b/src/rest/generated/docs/DatasetQueryFilterCreateRequest.md new file mode 100644 index 0000000..cb5c2da --- /dev/null +++ b/src/rest/generated/docs/DatasetQueryFilterCreateRequest.md @@ -0,0 +1,21 @@ + +# DatasetQueryFilterCreateRequest + + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`description` | string +`filter` | string +`pipeline` | string +`disabled` | boolean +`startTime` | string +`endTime` | string +`layout` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetQueryFilterResource.md b/src/rest/generated/docs/DatasetQueryFilterResource.md new file mode 100644 index 0000000..5698df0 --- /dev/null +++ b/src/rest/generated/docs/DatasetQueryFilterResource.md @@ -0,0 +1,27 @@ + +# DatasetQueryFilterResource + + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`label` | string +`description` | string +`filter` | string +`pipeline` | string +`disabled` | boolean +`errors` | Array<string> +`createdBy` | [User](User.md) +`createdAt` | string +`updatedBy` | [User](User.md) +`updatedAt` | string +`startTime` | string +`endTime` | string +`layout` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetQueryFilterUpdateRequest.md b/src/rest/generated/docs/DatasetQueryFilterUpdateRequest.md new file mode 100644 index 0000000..0949261 --- /dev/null +++ b/src/rest/generated/docs/DatasetQueryFilterUpdateRequest.md @@ -0,0 +1,21 @@ + +# DatasetQueryFilterUpdateRequest + + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`description` | string +`filter` | string +`pipeline` | string +`disabled` | boolean +`startTime` | string +`endTime` | string +`layout` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetRef.md b/src/rest/generated/docs/DatasetRef.md new file mode 100644 index 0000000..26175f3 --- /dev/null +++ b/src/rest/generated/docs/DatasetRef.md @@ -0,0 +1,16 @@ + +# DatasetRef + +A reference to a dataset. Always carries the id; the optional `record` field carries the brief metadata, populated when expand=true. Mirrors ObjectRef (see ObjectRef / ObjectBrief in this file). + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`record` | [DatasetBrief](DatasetBrief.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetRelatedKey.md b/src/rest/generated/docs/DatasetRelatedKey.md new file mode 100644 index 0000000..169240a --- /dev/null +++ b/src/rest/generated/docs/DatasetRelatedKey.md @@ -0,0 +1,17 @@ + +# DatasetRelatedKey + + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`targetDataset` | [DatasetRef](DatasetRef.md) +`srcFields` | Array<string> +`dstFields` | Array<string> + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetResource.md b/src/rest/generated/docs/DatasetResource.md new file mode 100644 index 0000000..c5ae08a --- /dev/null +++ b/src/rest/generated/docs/DatasetResource.md @@ -0,0 +1,54 @@ + +# DatasetResource + +Observe Dataset with properties. + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`label` | string +`description` | string +`icon` | string +`kind` | [DatasetDatasetKind](DatasetDatasetKind.md) +`source` | string +`lastUpdateSource` | string +`fieldList` | [Array<DatasetFieldDesc>](DatasetFieldDesc.md) +`validFromField` | string +`validToField` | string +`labelField` | string +`primaryKey` | Array<string> +`candidateKeys` | Array<Array<string>> +`foreignKeys` | [Array<DatasetForeignKey>](DatasetForeignKey.md) +`relatedKeys` | [Array<DatasetRelatedKey>](DatasetRelatedKey.md) +`groupingKey` | [DatasetGroupingKey](DatasetGroupingKey.md) +`correlationTags` | [Array<DatasetCorrelationTag>](DatasetCorrelationTag.md) +`isSource` | boolean +`interfaces` | [Array<DatasetImplementedInterface>](DatasetImplementedInterface.md) +`contentType` | [DatasetContentType](DatasetContentType.md) +`customFieldMappings` | { [key: string]: Array<string> | undefined; } +`objectTags` | { [key: string]: Array<string> | undefined; } +`alignment` | [DatasetTimeAlignment](DatasetTimeAlignment.md) +`compilationError` | [DatasetCompilationError](DatasetCompilationError.md) +`managedBy` | [ObjectRef](ObjectRef.md) +`dataTableViewState` | string +`defaultDashboard` | [ObjectRef](ObjectRef.md) +`defaultInstanceDashboard` | [ObjectRef](ObjectRef.md) +`isView` | boolean +`isMonitor` | boolean +`isMetricSMA` | boolean +`accelerationType` | [DatasetAccelerationType](DatasetAccelerationType.md) +`accelerationInfo` | [DatasetAccelerationInfo](DatasetAccelerationInfo.md) +`createdBy` | [User](User.md) +`updatedBy` | [User](User.md) +`createdAt` | string +`updatedAt` | string +`storageIntegration` | [StorageIntegrationRef](StorageIntegrationRef.md) +`definitionType` | [DatasetDefinitionType](DatasetDefinitionType.md) +`score` | number + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetStalenessReason.md b/src/rest/generated/docs/DatasetStalenessReason.md new file mode 100644 index 0000000..f8c2587 --- /dev/null +++ b/src/rest/generated/docs/DatasetStalenessReason.md @@ -0,0 +1,14 @@ + +# DatasetStalenessReason + +A reason explaining why a dataset\'s freshness is what it is. ConfiguredFreshnessGoal: The user-configured freshness goal is the dominant factor. CreditManagerOverride: A customer-level acceleration credit limit is forcing the freshness goal higher. SlowAcceleration: The dataset is being de-prioritized because it has not been queried recently (decay). ActiveBackfill: A backfill job is currently running for this dataset. DatasetHibernated: The dataset is hibernated. UnusedDatasetHibernating: The dataset is becoming hibernated due to lack of use. + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetStatValueCount.md b/src/rest/generated/docs/DatasetStatValueCount.md new file mode 100644 index 0000000..b6b95c0 --- /dev/null +++ b/src/rest/generated/docs/DatasetStatValueCount.md @@ -0,0 +1,15 @@ + +# DatasetStatValueCount + + +## Properties + +Name | Type +------------ | ------------- +`value` | string +`count` | number + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetStatsMeta.md b/src/rest/generated/docs/DatasetStatsMeta.md new file mode 100644 index 0000000..b9547e0 --- /dev/null +++ b/src/rest/generated/docs/DatasetStatsMeta.md @@ -0,0 +1,15 @@ + +# DatasetStatsMeta + + +## Properties + +Name | Type +------------ | ------------- +`totalDatasets` | number +`filteredDatasets` | number + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetStatsResponse.md b/src/rest/generated/docs/DatasetStatsResponse.md new file mode 100644 index 0000000..a9e59d2 --- /dev/null +++ b/src/rest/generated/docs/DatasetStatsResponse.md @@ -0,0 +1,17 @@ + +# DatasetStatsResponse + +Aggregated stats for requested dataset attributes + +## Properties + +Name | Type +------------ | ------------- +`attributes` | [Array<DatasetAttributeStats>](DatasetAttributeStats.md) +`multiValueAttributes` | [Array<DatasetAttributeStats>](DatasetAttributeStats.md) +`meta` | [DatasetStatsMeta](DatasetStatsMeta.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DatasetTimeAlignment.md b/src/rest/generated/docs/DatasetTimeAlignment.md new file mode 100644 index 0000000..e94b25b --- /dev/null +++ b/src/rest/generated/docs/DatasetTimeAlignment.md @@ -0,0 +1,15 @@ + +# DatasetTimeAlignment + + +## Properties + +Name | Type +------------ | ------------- +`stepSizeNanoseconds` | string +`offsetNanoseconds` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DocumentationApi.md b/src/rest/generated/docs/DocumentationApi.md new file mode 100644 index 0000000..170d5b6 --- /dev/null +++ b/src/rest/generated/docs/DocumentationApi.md @@ -0,0 +1,85 @@ +# DocumentationApi + +All URIs are relative to *https://OBSERVE_CUSTOMERID.observeinc.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**searchDocumentation**](DocumentationApi.md#searchdocumentation) | **POST** /v1/documentation/search | Search documentation | + + + +## searchDocumentation + +> DocumentationSearchResponse searchDocumentation(documentationSearchRequest) + +Search documentation + +Semantic search across Observe\'s built-in documentation. Given a natural-language query, returns the most relevant documentation chunks ranked by cosine similarity. Results are returned at the chunk level, not whole documents. A single documentation page may be split into multiple chunks, each with its own embedding and score. Multiple chunks from the same source page can appear in the results. + +### Example + +```ts +import { + Configuration, + DocumentationApi, +} from ''; +import type { SearchDocumentationRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new DocumentationApi(config); + + const body = { + // DocumentationSearchRequest + documentationSearchRequest: ..., + } satisfies SearchDocumentationRequest; + + try { + const data = await api.searchDocumentation(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **documentationSearchRequest** | [DocumentationSearchRequest](DocumentationSearchRequest.md) | | | + +### Return type + +[**DocumentationSearchResponse**](DocumentationSearchResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Search completed successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/src/rest/generated/docs/DocumentationSearchRequest.md b/src/rest/generated/docs/DocumentationSearchRequest.md new file mode 100644 index 0000000..00d2681 --- /dev/null +++ b/src/rest/generated/docs/DocumentationSearchRequest.md @@ -0,0 +1,16 @@ + +# DocumentationSearchRequest + + +## Properties + +Name | Type +------------ | ------------- +`query` | string +`limit` | number +`minScore` | number + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DocumentationSearchResponse.md b/src/rest/generated/docs/DocumentationSearchResponse.md new file mode 100644 index 0000000..79b0b6a --- /dev/null +++ b/src/rest/generated/docs/DocumentationSearchResponse.md @@ -0,0 +1,15 @@ + +# DocumentationSearchResponse + + +## Properties + +Name | Type +------------ | ------------- +`documentation` | [Array<DocumentationSearchResult>](DocumentationSearchResult.md) +`meta` | [Meta](Meta.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/DocumentationSearchResult.md b/src/rest/generated/docs/DocumentationSearchResult.md new file mode 100644 index 0000000..10f2c52 --- /dev/null +++ b/src/rest/generated/docs/DocumentationSearchResult.md @@ -0,0 +1,16 @@ + +# DocumentationSearchResult + + +## Properties + +Name | Type +------------ | ------------- +`title` | string +`text` | string +`url` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ErrorMessage.md b/src/rest/generated/docs/ErrorMessage.md new file mode 100644 index 0000000..d1b5580 --- /dev/null +++ b/src/rest/generated/docs/ErrorMessage.md @@ -0,0 +1,15 @@ + +# ErrorMessage + + +## Properties + +Name | Type +------------ | ------------- +`type` | string +`message` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ExportApi.md b/src/rest/generated/docs/ExportApi.md new file mode 100644 index 0000000..02136cb --- /dev/null +++ b/src/rest/generated/docs/ExportApi.md @@ -0,0 +1,268 @@ +# ExportApi + +All URIs are relative to *https://OBSERVE_CUSTOMERID.observeinc.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**exportQuery**](ExportApi.md#exportqueryoperation) | **POST** /v1/meta/export/query | Execute an OPAL query | +| [**exportQueryPage**](ExportApi.md#exportquerypage) | **GET** /v1/meta/export/query/page | Fetch a page of query results | +| [**exportWorksheet**](ExportApi.md#exportworksheet) | **POST** /v1/meta/export/worksheet/{worksheetId} | Export a worksheet | + + + +## exportQuery + +> string exportQuery(exportQueryRequest, startTime, endTime, interval, stage, paginate) + +Execute an OPAL query + +Execute an OPAL query. Results can be returned as CSV or NDJSON. * Set Accept header to `text/csv` or `application/x-ndjson` * Default: CSV Either two of `startTime`, `endTime`, and `interval` or `interval` alone can be specified to set the time interval. The `startTime` parameter is inclusive and the `endTime` parameter is exclusive, to prevent overlap from subsequent windows. * `interval`: An interval relative to now * `startTime` + `endTime`: The specified time interval * `startTime` **or** `endTime` + `interval`: The specified time interval relative to the provided start or end time Inputs are specified as dataset IDs, or previously-defined stages. Set paginate to true for an asynchronous paginated mode. The response will be 202 Accepted and contain headers for fetching the results via `/v1/meta/export/query/page`. You may also want to increase rowCount to allow large, paginated queries. + +### Example + +```ts +import { + Configuration, + ExportApi, +} from ''; +import type { ExportQueryOperationRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ExportApi(config); + + const body = { + // ExportQueryRequest | The OPAL query text and input dataset bindings. + exportQueryRequest: {"query":{"outputStage":"myStage","stages":[{"input":[{"inputName":"main","datasetId":"41007104"},{"inputName":"rds","datasetPath":"Workspace.aws/RDS Cluster"}],"stageID":"myStage","pipeline":"pick_col timestamp, log, namespace, containerName, rdsArn\nleftjoin on(rdsArn=@rds.arn), db:@rds.DBClusterIdentifier\n"}]},"rowCount":"2"}, + // string | Beginning of time window (inclusive) as ISO time. (optional) + startTime: 2023-04-20T16:20:00Z, + // string | End of time window (exclusive) as ISO time. Defaults to now if just `interval` is specified. (optional) + endTime: 2023-04-20T16:30:00Z, + // string | Length of time window (if start or end is missing). (optional) + interval: 10m, + // string | Which stage to get the data from. Defaults to last stage. (optional) + stage: stage_example, + // boolean | Whether to switch to an asynchronous paginated mode. Defaults to false. (optional) + paginate: true, + } satisfies ExportQueryOperationRequest; + + try { + const data = await api.exportQuery(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **exportQueryRequest** | [ExportQueryRequest](ExportQueryRequest.md) | The OPAL query text and input dataset bindings. | | +| **startTime** | `string` | Beginning of time window (inclusive) as ISO time. | [Optional] [Defaults to `undefined`] | +| **endTime** | `string` | End of time window (exclusive) as ISO time. Defaults to now if just `interval` is specified. | [Optional] [Defaults to `undefined`] | +| **interval** | `string` | Length of time window (if start or end is missing). | [Optional] [Defaults to `undefined`] | +| **stage** | `string` | Which stage to get the data from. Defaults to last stage. | [Optional] [Defaults to `undefined`] | +| **paginate** | `boolean` | Whether to switch to an asynchronous paginated mode. Defaults to false. | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/x-ndjson`, `text/csv` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | ## Description of result data formats ### Content-type: application/x-ndjson The results are returned with each row represented as distinct json objects separated by newlines. The contents of the json object representing each row is keys representing each column in the output, with values representing the value of that that column for that row. ### Content-type: text/csv The results are returned in csv format, the first row in csv is a header row with the names of the columns. | - | +| **202** | The paginated query request was accepted and will be executed asynchronously. The response contains two headers that can be used to fetch the results. There is no body sent. | * X-Observe-Cursor-Id - The ID of a cursor that can be used to fetch the results; to be used with the /v1/meta/export/query/page endpoint. See that endpoint for more details.
* X-Observe-Next-Page - A link to the first page of results, which will contain the cursor ID query parameter, but will omit the offset and numRows query parameters. Those defaults can be overriden by adding them to the query parameters.
| +| **206** | The query was executed successfully, but the results returned cover only a part of the query window. This happens when the datasets queried are not accelerated for the entire query window. ## Description of result data formats ### Content-type: application/x-ndjson The results are returned with each row represented as distinct json objects separated by newlines. The contents of the json object representing each row is keys representing each column in the output, with values representing the value of that that column for that row. ### Content-type: text/csv The results are returned in csv format, the first row in csv is a header row with the names of the columns. | - | +| **400** | Query not accepted. | - | +| **401** | Authorization missing. | - | +| **403** | Authorization denied. | - | +| **429** | Rate limit exceeded. | - | +| **500** | Internal error: query error. | - | +| **504** | Internal error: infrastructure error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## exportQueryPage + +> string exportQueryPage(cursorId, offset, numRows) + +Fetch a page of query results + +Fetch the results of a paginated \"/v1/meta/export/query\" request. Note that paginate must be set to true and rowCount should be set high enough to contain the total expected result set. This endpoint uses long polling behavior. If a query is in progress when a request is made, the server will delay responding for up to 30 seconds. If the query completes in that time period, the results will be returned with a 200 response code. Otherwise a 202 response code will be returned, and the client should retry the request. The endpoint will also return an error if the query failed. Queries for paginated data will return an `X-Observe-Total-Rows` header and an `X-Observe-Next-Page` header with a URL for the next page, as long as one is needed. You can use the `X-Observe-Cursor-Id` and the `offset` and `numRows` parameters to construct your own next page URL with different page sizes. The results can be returned as CSV or NDJSON. The query parameters are used to specify which page of results to fetch. * Set Accept header to `text/csv` or `application/x-ndjson` * Default: CSV The number of rows in the full result set is returned in the X-Observe-Total-Rows response header. + +### Example + +```ts +import { + Configuration, + ExportApi, +} from ''; +import type { ExportQueryPageRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ExportApi(config); + + const body = { + // string | The ID of a cursor + cursorId: 123e4567-e89b-12d3-a456-426614174000, + // string | Offset into the result set for the page to begin at (optional) + offset: 1000, + // string | The number of rows to return in the page (optional) + numRows: 1000, + } satisfies ExportQueryPageRequest; + + try { + const data = await api.exportQueryPage(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **cursorId** | `string` | The ID of a cursor | [Defaults to `undefined`] | +| **offset** | `string` | Offset into the result set for the page to begin at | [Optional] [Defaults to `undefined`] | +| **numRows** | `string` | The number of rows to return in the page | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/x-ndjson`, `text/csv` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The query is completed and the requested page of results are returned in the body in the format requested by the Accept header. The total number of rows in the full result set is returned in the X-Observe-Total-Rows response header. ## Description of result data formats ### Content-type: application/x-ndjson The results are returned with each row represented as distinct json objects separated by newlines. The contents of the json object representing each row is keys representing each column in the output, with values representing the value of that that column for that row. ### Content-type: text/csv The results are returned in csv format, the first row in csv is a header row with the names of the columns. | * X-Observe-Next-Page - A link to the next page of results if there is one, otherwise this header is not present.
* X-Observe-Total-Rows - The number of rows in the full result set.
| +| **202** | The query is still in progress; even after waiting for 30 seconds from the request being recieved. The body of the response will be empty. The response headers contain the following: | * X-Observe-Next-Page - A link to the first page of results.
| +| **400** | Invalid request. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## exportWorksheet + +> string exportWorksheet(worksheetId, startTime, endTime, interval, stage) + +Export a worksheet + +Export data used by a worksheet. Results are limited to a maximum of 100,000 rows. Results can be returned as CSV or NDJSON. * Set Accept header to `text/csv` or `application/x-ndjson` * Default: CSV Either two of `startTime`, `endTime`, and `interval` or `interval` alone can be specified to set the time interval. The `startTime` parameter is inclusive and the `endTime` parameter is exclusive, to prevent overlap from subsequent windows. * `interval`: An interval relative to now * `startTime` + `endTime`: The specified time interval * `startTime` **or** `endTime` + `interval`: The specified time interval relative to the provided start or end time + +### Example + +```ts +import { + Configuration, + ExportApi, +} from ''; +import type { ExportWorksheetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ExportApi(config); + + const body = { + // number | ID of the worksheet to export. + worksheetId: 123456789, + // string | Beginning of time window (inclusive) as ISO time. (optional) + startTime: 2023-04-20T16:20:00Z, + // string | End of time window (exclusive) as ISO time. Defaults to now if just `interval` is specified. (optional) + endTime: 2023-04-20T16:30:00Z, + // string | Length of time window (if start or end is missing). (optional) + interval: 10m, + // string | Which stage to get the data from. Defaults to last stage. (optional) + stage: stage_example, + } satisfies ExportWorksheetRequest; + + try { + const data = await api.exportWorksheet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **worksheetId** | `number` | ID of the worksheet to export. | [Defaults to `undefined`] | +| **startTime** | `string` | Beginning of time window (inclusive) as ISO time. | [Optional] [Defaults to `undefined`] | +| **endTime** | `string` | End of time window (exclusive) as ISO time. Defaults to now if just `interval` is specified. | [Optional] [Defaults to `undefined`] | +| **interval** | `string` | Length of time window (if start or end is missing). | [Optional] [Defaults to `undefined`] | +| **stage** | `string` | Which stage to get the data from. Defaults to last stage. | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/x-ndjson`, `text/csv` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | ## Description of result data formats ### Content-type: application/x-ndjson The results are returned with each row represented as distinct json objects separated by newlines. The contents of the json object representing each row is keys representing each column in the output, with values representing the value of that that column for that row. ### Content-type: text/csv The results are returned in csv format, the first row in csv is a header row with the names of the columns. | - | +| **400** | Invalid request. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/src/rest/generated/docs/ExportQueryRequest.md b/src/rest/generated/docs/ExportQueryRequest.md new file mode 100644 index 0000000..de8bc76 --- /dev/null +++ b/src/rest/generated/docs/ExportQueryRequest.md @@ -0,0 +1,16 @@ + +# ExportQueryRequest + + +## Properties + +Name | Type +------------ | ------------- +`query` | [ExportQueryRequestQuery](ExportQueryRequestQuery.md) +`rowCount` | string +`presentation` | [StagePresentationInput](StagePresentationInput.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ExportQueryRequestQuery.md b/src/rest/generated/docs/ExportQueryRequestQuery.md new file mode 100644 index 0000000..b5fd672 --- /dev/null +++ b/src/rest/generated/docs/ExportQueryRequestQuery.md @@ -0,0 +1,18 @@ + +# ExportQueryRequestQuery + +Encodes the actual OPAL query and its inputs. + +## Properties + +Name | Type +------------ | ------------- +`outputStage` | string +`stages` | [Array<ExportQueryRequestQueryStagesInner>](ExportQueryRequestQueryStagesInner.md) +`parameters` | [Array<ParameterArrayInner>](ParameterArrayInner.md) +`parameterValues` | [Array<ParameterValueArrayInner>](ParameterValueArrayInner.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ExportQueryRequestQueryStagesInner.md b/src/rest/generated/docs/ExportQueryRequestQueryStagesInner.md new file mode 100644 index 0000000..ea82bd3 --- /dev/null +++ b/src/rest/generated/docs/ExportQueryRequestQueryStagesInner.md @@ -0,0 +1,18 @@ + +# ExportQueryRequestQueryStagesInner + + +## Properties + +Name | Type +------------ | ------------- +`input` | [Array<InputDefinition>](InputDefinition.md) +`stageID` | string +`pipeline` | string +`parameters` | [Array<ParameterArrayInner>](ParameterArrayInner.md) +`parameterValues` | [Array<ParameterValueArrayInner>](ParameterValueArrayInner.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/GenerateAPITokenRequest.md b/src/rest/generated/docs/GenerateAPITokenRequest.md new file mode 100644 index 0000000..91484e9 --- /dev/null +++ b/src/rest/generated/docs/GenerateAPITokenRequest.md @@ -0,0 +1,16 @@ + +# GenerateAPITokenRequest + + +## Properties + +Name | Type +------------ | ------------- +`userEmail` | string +`userPassword` | string +`tokenName` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/GetDatasetById200Response.md b/src/rest/generated/docs/GetDatasetById200Response.md new file mode 100644 index 0000000..92d1308 --- /dev/null +++ b/src/rest/generated/docs/GetDatasetById200Response.md @@ -0,0 +1,15 @@ + +# GetDatasetById200Response + + +## Properties + +Name | Type +------------ | ------------- +`ok` | boolean +`data` | [DatasetLegacyResource](DatasetLegacyResource.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/InputDefinition.md b/src/rest/generated/docs/InputDefinition.md new file mode 100644 index 0000000..21281f9 --- /dev/null +++ b/src/rest/generated/docs/InputDefinition.md @@ -0,0 +1,19 @@ + +# InputDefinition + + +## Properties + +Name | Type +------------ | ------------- +`inputName` | string +`inputRole` | string +`datasetId` | string +`datasetPath` | string +`stageId` | string +`parameterId` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ListDatasetQueryFilters200Response.md b/src/rest/generated/docs/ListDatasetQueryFilters200Response.md new file mode 100644 index 0000000..19a2558 --- /dev/null +++ b/src/rest/generated/docs/ListDatasetQueryFilters200Response.md @@ -0,0 +1,15 @@ + +# ListDatasetQueryFilters200Response + + +## Properties + +Name | Type +------------ | ------------- +`queryFilters` | [Array<DatasetQueryFilterResource>](DatasetQueryFilterResource.md) +`meta` | [Meta](Meta.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ListDatasetsResponse.md b/src/rest/generated/docs/ListDatasetsResponse.md new file mode 100644 index 0000000..095dc38 --- /dev/null +++ b/src/rest/generated/docs/ListDatasetsResponse.md @@ -0,0 +1,15 @@ + +# ListDatasetsResponse + + +## Properties + +Name | Type +------------ | ------------- +`ok` | boolean +`data` | [Array<DatasetLegacyResource>](DatasetLegacyResource.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/LoginApi.md b/src/rest/generated/docs/LoginApi.md new file mode 100644 index 0000000..d97584b --- /dev/null +++ b/src/rest/generated/docs/LoginApi.md @@ -0,0 +1,215 @@ +# LoginApi + +All URIs are relative to *https://OBSERVE_CUSTOMERID.observeinc.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**generateAPIToken**](LoginApi.md#generateapitokenoperation) | **POST** /v1/login | Generate an API token | +| [**pollDelegatedLogin**](LoginApi.md#polldelegatedlogin) | **GET** /v1/login/delegated/{serverToken} | Poll the status of a pending login request | +| [**startDelegatedLogin**](LoginApi.md#startdelegatedloginoperation) | **POST** /v1/login/delegated | Start an Observe authtoken creation flow | + + + +## generateAPIToken + +> string generateAPIToken(generateAPITokenRequest) + +Generate an API token + +Given an email address and a password, generate an API authorization token. This token can be used with Bearer authorization when used together with the customer ID. (The customer ID is the same as the first number in the API server URL.) ``` Authorization: Bearer <customerid> <apitoken> ``` Only \"local\" users that have a password can use this API; SSO users cannot log in using a password. This endpoint does not itself need to Authorization header. + +### Example + +```ts +import { + Configuration, + LoginApi, +} from ''; +import type { GenerateAPITokenOperationRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new LoginApi(); + + const body = { + // GenerateAPITokenRequest | The login username and password. + generateAPITokenRequest: {"user_email":"user@example.com","user_password":"hunter1","tokenName":"for the coin tracker integration"}, + } satisfies GenerateAPITokenOperationRequest; + + try { + const data = await api.generateAPIToken(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **generateAPITokenRequest** | [GenerateAPITokenRequest](GenerateAPITokenRequest.md) | The login username and password. | | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | ## Description of result data formats ### Content-type: application/json The response contains an \'ok\' field (boolean) and an \"access_key\" field (string). The \"access_key\" is a secret value and is as good as the password for accessing the customer instance, so treat it with care. You must remember it, because it is not stored and cannot be retrieved again, although another access key can be generated through another invocation of the API. By default, access keys that are not used, are invalidated after about 10 days of inactivity. | - | +| **400** | Invalid request. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## pollDelegatedLogin + +> PollDelegatedLogin200Response pollDelegatedLogin(serverToken) + +Poll the status of a pending login request + +This endpoint polls the status of a pending login request. The serverToken is returned from the initial request, and is used to identify the request. + +### Example + +```ts +import { + Configuration, + LoginApi, +} from ''; +import type { PollDelegatedLoginRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new LoginApi(); + + const body = { + // string | The serverToken returned from the initial request. + serverToken: serverToken_example, + } satisfies PollDelegatedLoginRequest; + + try { + const data = await api.pollDelegatedLogin(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **serverToken** | `string` | The serverToken returned from the initial request. | [Defaults to `undefined`] | + +### Return type + +[**PollDelegatedLogin200Response**](PollDelegatedLogin200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request is still pending, or has been accepted, denied, or timed out. | - | +| **400** | Invalid request. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## startDelegatedLogin + +> StartDelegatedLogin200Response startDelegatedLogin(startDelegatedLoginRequest) + +Start an Observe authtoken creation flow + +This endpoint starts an authorization flow that lets an Observe user generate an authorization token to use for external tools and scripts. This token will have the same powers as the user authorizing, and can be passed in the `Authorization: Bearer <customerid> <apitoken>` header of requqests. This endpoint will return with a URL that the user should visit in a web browser to allow the token creation; that URL will lead to a page that requires the user to be logged in (through whatever password or SSO mechanism the user normally uses.) The response from this endpoint also includes a \"serverToken\" field, which is a token that can be used to poll the tenant for the status of the token creation, and if successful, will return the issued access key. Essentially, this endpoint implements the Oauth \"device\" authorization flow. + +### Example + +```ts +import { + Configuration, + LoginApi, +} from ''; +import type { StartDelegatedLoginOperationRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new LoginApi(); + + const body = { + // StartDelegatedLoginRequest | The credentials to authorize as. + startDelegatedLoginRequest: {"userEmail":"user@example.com","clientToken":"ZrL5BhtFXvu2Xe78GznP1dP2Ts81ZszA","integration":"observe-tool-abdaf0"}, + } satisfies StartDelegatedLoginOperationRequest; + + try { + const data = await api.startDelegatedLogin(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **startDelegatedLoginRequest** | [StartDelegatedLoginRequest](StartDelegatedLoginRequest.md) | The credentials to authorize as. | | + +### Return type + +[**StartDelegatedLogin200Response**](StartDelegatedLogin200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | This request generates a \"pending\" login request, which the user will have to authorize on the Observe website. Send the user to the given URL in a web browser, and then poll the API for the completion endpoint to see whether the user accepts, denies, or times out the request. | - | +| **400** | Invalid request. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/src/rest/generated/docs/Meta.md b/src/rest/generated/docs/Meta.md new file mode 100644 index 0000000..cd50534 --- /dev/null +++ b/src/rest/generated/docs/Meta.md @@ -0,0 +1,15 @@ + +# Meta + +List Response Metadata + +## Properties + +Name | Type +------------ | ------------- +`totalCount` | number + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorApi.md b/src/rest/generated/docs/MonitorApi.md new file mode 100644 index 0000000..66722b5 --- /dev/null +++ b/src/rest/generated/docs/MonitorApi.md @@ -0,0 +1,659 @@ +# MonitorApi + +All URIs are relative to *https://OBSERVE_CUSTOMERID.observeinc.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createMonitor**](MonitorApi.md#createmonitor) | **POST** /v1/monitors | Create a new MonitorV2 and bind to actions | +| [**createMonitorMuteRule**](MonitorApi.md#createmonitormuterule) | **POST** /v1/monitor-mute-rules | Create a new MonitorV2 Mute Rule | +| [**deleteMonitor**](MonitorApi.md#deletemonitor) | **DELETE** /v1/monitors/{id} | Delete a MonitorV2 | +| [**deleteMonitorMuteRule**](MonitorApi.md#deletemonitormuterule) | **DELETE** /v1/monitor-mute-rules/{id} | Delete a MonitorV2 Mute Rule | +| [**getMonitor**](MonitorApi.md#getmonitor) | **GET** /v1/monitors/{id} | Get a MonitorV2 | +| [**getMonitorMuteRule**](MonitorApi.md#getmonitormuterule) | **GET** /v1/monitor-mute-rules/{id} | Get a MonitorV2 Mute Rule | +| [**listMonitorMuteRules**](MonitorApi.md#listmonitormuterules) | **GET** /v1/monitor-mute-rules | List MonitorV2 Mute Rules with optional filters | +| [**listMonitors**](MonitorApi.md#listmonitors) | **GET** /v1/monitors | List MonitorV2 instances with optional filters | +| [**updateMonitor**](MonitorApi.md#updatemonitor) | **PATCH** /v1/monitors/{id} | Update a MonitorV2 | + + + +## createMonitor + +> MonitorV2 createMonitor(monitorV2) + +Create a new MonitorV2 and bind to actions + +### Example + +```ts +import { + Configuration, + MonitorApi, +} from ''; +import type { CreateMonitorRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new MonitorApi(config); + + const body = { + // MonitorV2 | The MonitorV2 to create + monitorV2: ..., + } satisfies CreateMonitorRequest; + + try { + const data = await api.createMonitor(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **monitorV2** | [MonitorV2](MonitorV2.md) | The MonitorV2 to create | | + +### Return type + +[**MonitorV2**](MonitorV2.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | The monitor was created | * Location - The URI to the newly created monitor
| +| **400** | Invalid request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createMonitorMuteRule + +> MonitorV2MuteRule createMonitorMuteRule(monitorV2MuteRule) + +Create a new MonitorV2 Mute Rule + +### Example + +```ts +import { + Configuration, + MonitorApi, +} from ''; +import type { CreateMonitorMuteRuleRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new MonitorApi(config); + + const body = { + // MonitorV2MuteRule | The MonitorV2 Mute Rule to create + monitorV2MuteRule: ..., + } satisfies CreateMonitorMuteRuleRequest; + + try { + const data = await api.createMonitorMuteRule(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **monitorV2MuteRule** | [MonitorV2MuteRule](MonitorV2MuteRule.md) | The MonitorV2 Mute Rule to create | | + +### Return type + +[**MonitorV2MuteRule**](MonitorV2MuteRule.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | The mute rule was created | * Location - The URI to the newly created mute rule
| +| **400** | Invalid request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteMonitor + +> deleteMonitor(id) + +Delete a MonitorV2 + +### Example + +```ts +import { + Configuration, + MonitorApi, +} from ''; +import type { DeleteMonitorRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new MonitorApi(config); + + const body = { + // number | The Monitor object id + id: 56, + } satisfies DeleteMonitorRequest; + + try { + const data = await api.deleteMonitor(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `number` | The Monitor object id | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | The object was deleted | - | +| **400** | Invalid request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteMonitorMuteRule + +> deleteMonitorMuteRule(id) + +Delete a MonitorV2 Mute Rule + +### Example + +```ts +import { + Configuration, + MonitorApi, +} from ''; +import type { DeleteMonitorMuteRuleRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new MonitorApi(config); + + const body = { + // number | The Mute Rule object id + id: 56, + } satisfies DeleteMonitorMuteRuleRequest; + + try { + const data = await api.deleteMonitorMuteRule(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `number` | The Mute Rule object id | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | The object was deleted | - | +| **400** | Invalid request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getMonitor + +> MonitorV2 getMonitor(id) + +Get a MonitorV2 + +### Example + +```ts +import { + Configuration, + MonitorApi, +} from ''; +import type { GetMonitorRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new MonitorApi(config); + + const body = { + // number | The Monitor object id + id: 56, + } satisfies GetMonitorRequest; + + try { + const data = await api.getMonitor(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `number` | The Monitor object id | [Defaults to `undefined`] | + +### Return type + +[**MonitorV2**](MonitorV2.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The object is returned | - | +| **404** | The object was not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getMonitorMuteRule + +> MonitorV2MuteRule getMonitorMuteRule(id) + +Get a MonitorV2 Mute Rule + +### Example + +```ts +import { + Configuration, + MonitorApi, +} from ''; +import type { GetMonitorMuteRuleRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new MonitorApi(config); + + const body = { + // number | The Mute Rule object id + id: 56, + } satisfies GetMonitorMuteRuleRequest; + + try { + const data = await api.getMonitorMuteRule(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `number` | The Mute Rule object id | [Defaults to `undefined`] | + +### Return type + +[**MonitorV2MuteRule**](MonitorV2MuteRule.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The object is returned | - | +| **404** | The object was not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listMonitorMuteRules + +> Array<MonitorV2MuteRuleTerse> listMonitorMuteRules(nameExact, nameSubstring) + +List MonitorV2 Mute Rules with optional filters + +### Example + +```ts +import { + Configuration, + MonitorApi, +} from ''; +import type { ListMonitorMuteRulesRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new MonitorApi(config); + + const body = { + // string | limit to an exact string match (optional) + nameExact: nameExact_example, + // string | limit to a substring match (optional) + nameSubstring: nameSubstring_example, + } satisfies ListMonitorMuteRulesRequest; + + try { + const data = await api.listMonitorMuteRules(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **nameExact** | `string` | limit to an exact string match | [Optional] [Defaults to `undefined`] | +| **nameSubstring** | `string` | limit to a substring match | [Optional] [Defaults to `undefined`] | + +### Return type + +[**Array<MonitorV2MuteRuleTerse>**](MonitorV2MuteRuleTerse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | An array of mute rule objects is returned | - | +| **400** | Invalid request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listMonitors + +> Array<MonitorV2Terse> listMonitors(nameExact, nameSubstring) + +List MonitorV2 instances with optional filters + +### Example + +```ts +import { + Configuration, + MonitorApi, +} from ''; +import type { ListMonitorsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new MonitorApi(config); + + const body = { + // string | limit to an exact string match (optional) + nameExact: nameExact_example, + // string | limit to a substring match (optional) + nameSubstring: nameSubstring_example, + } satisfies ListMonitorsRequest; + + try { + const data = await api.listMonitors(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **nameExact** | `string` | limit to an exact string match | [Optional] [Defaults to `undefined`] | +| **nameSubstring** | `string` | limit to a substring match | [Optional] [Defaults to `undefined`] | + +### Return type + +[**Array<MonitorV2Terse>**](MonitorV2Terse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | An array of monitor objects is returned | - | +| **400** | Invalid request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateMonitor + +> updateMonitor(id, monitorV2PatchRequest) + +Update a MonitorV2 + +Partially updates a monitor. Only **PATCH** is supported for this URL. **Top-level merge:** The server reads the current monitor, then for each of these properties—`name`, `disabled`, `description`, `ruleKind`, `definition`, `actionRules`—uses the request value if the key is present in the body, otherwise keeps the stored value. Keys omitted from the body do not change. **Replace entire subtrees:** If `definition` or `actionRules` appears in the body, it **replaces the whole** stored `definition` or `actionRules` value. The server does **not** deep-merge inside `definition`, inside individual action rules, or inside nested structures (for example an action rule’s `definition`). To change part of the monitor definition or action configuration, send the complete `definition` and/or full `actionRules` array you want saved. **Not controlled by the body:** Other monitor fields (such as `id` from the path, or `monitorVersion`) are not updated from this JSON body using the merge rules above. **Extra properties:** Any other top-level JSON properties in the body are ignored for this merge (they are not written to the monitor). + +### Example + +```ts +import { + Configuration, + MonitorApi, +} from ''; +import type { UpdateMonitorRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new MonitorApi(config); + + const body = { + // number | The Monitor object id + id: 56, + // MonitorV2PatchRequest | Any subset of patchable fields. Omitted keys among `name`, `disabled`, `description`, `ruleKind`, `definition`, and `actionRules` leave the corresponding stored values unchanged. When `definition` or `actionRules` is sent, it must be the full replacement value for that field. (optional) + monitorV2PatchRequest: ..., + } satisfies UpdateMonitorRequest; + + try { + const data = await api.updateMonitor(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `number` | The Monitor object id | [Defaults to `undefined`] | +| **monitorV2PatchRequest** | [MonitorV2PatchRequest](MonitorV2PatchRequest.md) | Any subset of patchable fields. Omitted keys among `name`, `disabled`, `description`, `ruleKind`, `definition`, and `actionRules` leave the corresponding stored values unchanged. When `definition` or `actionRules` is sent, it must be the full replacement value for that field. | [Optional] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | The object was updated | - | +| **400** | Invalid request | - | +| **404** | The object was not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/src/rest/generated/docs/MonitorBrief.md b/src/rest/generated/docs/MonitorBrief.md new file mode 100644 index 0000000..eef61b9 --- /dev/null +++ b/src/rest/generated/docs/MonitorBrief.md @@ -0,0 +1,16 @@ + +# MonitorBrief + +Brief monitor metadata included when a reference is expanded. + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`description` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteApi.md b/src/rest/generated/docs/MonitorMuteApi.md new file mode 100644 index 0000000..6e9a298 --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteApi.md @@ -0,0 +1,410 @@ +# MonitorMuteApi + +All URIs are relative to *https://OBSERVE_CUSTOMERID.observeinc.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createMonitorMute**](MonitorMuteApi.md#createmonitormute) | **POST** /v1/monitor-mutes | Create a monitor mute | +| [**deleteMonitorMute**](MonitorMuteApi.md#deletemonitormute) | **DELETE** /v1/monitor-mutes/{id} | Delete a monitor mute | +| [**getMonitorMute**](MonitorMuteApi.md#getmonitormute) | **GET** /v1/monitor-mutes/{id} | Get a monitor mute | +| [**listMonitorMutes**](MonitorMuteApi.md#listmonitormutes) | **GET** /v1/monitor-mutes | List monitor mutes | +| [**updateMonitorMute**](MonitorMuteApi.md#updatemonitormute) | **PATCH** /v1/monitor-mutes/{id} | Update a monitor mute | + + + +## createMonitorMute + +> MonitorMuteResource createMonitorMute(monitorMuteCreateRequest) + +Create a monitor mute + +### Example + +```ts +import { + Configuration, + MonitorMuteApi, +} from ''; +import type { CreateMonitorMuteRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new MonitorMuteApi(config); + + const body = { + // MonitorMuteCreateRequest + monitorMuteCreateRequest: ..., + } satisfies CreateMonitorMuteRequest; + + try { + const data = await api.createMonitorMute(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **monitorMuteCreateRequest** | [MonitorMuteCreateRequest](MonitorMuteCreateRequest.md) | | | + +### Return type + +[**MonitorMuteResource**](MonitorMuteResource.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Monitor mute created successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteMonitorMute + +> deleteMonitorMute(id) + +Delete a monitor mute + +### Example + +```ts +import { + Configuration, + MonitorMuteApi, +} from ''; +import type { DeleteMonitorMuteRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new MonitorMuteApi(config); + + const body = { + // string | The ID of the monitor mute to delete. + id: 1, + } satisfies DeleteMonitorMuteRequest; + + try { + const data = await api.deleteMonitorMute(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | The ID of the monitor mute to delete. | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Monitor mute deleted successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getMonitorMute + +> MonitorMuteResource getMonitorMute(id, expand) + +Get a monitor mute + +Retrieve a specific monitor mute rule by ID. + +### Example + +```ts +import { + Configuration, + MonitorMuteApi, +} from ''; +import type { GetMonitorMuteRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new MonitorMuteApi(config); + + const body = { + // string | The ID of the monitor mute to retrieve. + id: 1, + // boolean | When `true`, expands all referenced objects in the response: populates `record` on each `MonitorRef` in `target.monitors` with brief monitor metadata, and populates `label`, `timezone`, and `locale` on `createdBy` and `updatedBy`. `record` is omitted for any target monitor the caller is not authorized to read; its `id` is still returned, since the target id set is part of the rule\'s own configuration. (optional) + expand: true, + } satisfies GetMonitorMuteRequest; + + try { + const data = await api.getMonitorMute(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | The ID of the monitor mute to retrieve. | [Defaults to `undefined`] | +| **expand** | `boolean` | When `true`, expands all referenced objects in the response: populates `record` on each `MonitorRef` in `target.monitors` with brief monitor metadata, and populates `label`, `timezone`, and `locale` on `createdBy` and `updatedBy`. `record` is omitted for any target monitor the caller is not authorized to read; its `id` is still returned, since the target id set is part of the rule\'s own configuration. | [Optional] [Defaults to `undefined`] | + +### Return type + +[**MonitorMuteResource**](MonitorMuteResource.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Monitor mute retrieved successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listMonitorMutes + +> MonitorMuteListResponse listMonitorMutes(filter, expand, limit, offset, orderBy) + +List monitor mutes + +Returns a paginated list of monitor mute rules, optionally filtered by a CEL expression. + +### Example + +```ts +import { + Configuration, + MonitorMuteApi, +} from ''; +import type { ListMonitorMutesRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new MonitorMuteApi(config); + + const body = { + // string | CEL expression to filter results over mute rule fields (`label`, `target.kind`, `target.monitors.id`, `createdBy.id`). Supports `matches()` for regex. Example: `target.kind == \"Monitors\"`. (optional) + filter: filter_example, + // boolean | When `true`, expands all referenced objects in the response: populates `record` on each `MonitorRef` in `target.monitors` with brief monitor metadata, and populates `label`, `timezone`, and `locale` on `createdBy` and `updatedBy`. `record` is omitted for any target monitor the caller is not authorized to read; its `id` is still returned, since the target id set is part of the rule\'s own configuration. (optional) + expand: true, + // number | Maximum number of results to return. Defaults to 200, max 1000. (optional) + limit: 789, + // number | Number of results to skip for pagination. Defaults to 0. (optional) + offset: 789, + // string | Comma-separated fields to order by. Prefix with `-` for descending. Defaults to `id`. Example: `orderBy=createdAt,-label`. (optional) + orderBy: orderBy_example, + } satisfies ListMonitorMutesRequest; + + try { + const data = await api.listMonitorMutes(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **filter** | `string` | CEL expression to filter results over mute rule fields (`label`, `target.kind`, `target.monitors.id`, `createdBy.id`). Supports `matches()` for regex. Example: `target.kind == \"Monitors\"`. | [Optional] [Defaults to `undefined`] | +| **expand** | `boolean` | When `true`, expands all referenced objects in the response: populates `record` on each `MonitorRef` in `target.monitors` with brief monitor metadata, and populates `label`, `timezone`, and `locale` on `createdBy` and `updatedBy`. `record` is omitted for any target monitor the caller is not authorized to read; its `id` is still returned, since the target id set is part of the rule\'s own configuration. | [Optional] [Defaults to `undefined`] | +| **limit** | `number` | Maximum number of results to return. Defaults to 200, max 1000. | [Optional] [Defaults to `200`] | +| **offset** | `number` | Number of results to skip for pagination. Defaults to 0. | [Optional] [Defaults to `0`] | +| **orderBy** | `string` | Comma-separated fields to order by. Prefix with `-` for descending. Defaults to `id`. Example: `orderBy=createdAt,-label`. | [Optional] [Defaults to `undefined`] | + +### Return type + +[**MonitorMuteListResponse**](MonitorMuteListResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Monitor mutes listed successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateMonitorMute + +> MonitorMuteResource updateMonitorMute(id, monitorMuteUpdateRequest) + +Update a monitor mute + +Partially updates a monitor mute rule using JSON Merge Patch semantics. Only provided fields are updated; omitted fields remain unchanged. `target.kind` is immutable after creation; sending a `target` object replaces the entire target subtree atomically. + +### Example + +```ts +import { + Configuration, + MonitorMuteApi, +} from ''; +import type { UpdateMonitorMuteRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new MonitorMuteApi(config); + + const body = { + // string | The ID of the monitor mute to update. + id: 1, + // MonitorMuteUpdateRequest + monitorMuteUpdateRequest: ..., + } satisfies UpdateMonitorMuteRequest; + + try { + const data = await api.updateMonitorMute(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | The ID of the monitor mute to update. | [Defaults to `undefined`] | +| **monitorMuteUpdateRequest** | [MonitorMuteUpdateRequest](MonitorMuteUpdateRequest.md) | | | + +### Return type + +[**MonitorMuteResource**](MonitorMuteResource.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Monitor mute updated successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/src/rest/generated/docs/MonitorMuteCreateRequest.md b/src/rest/generated/docs/MonitorMuteCreateRequest.md new file mode 100644 index 0000000..c7762fa --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteCreateRequest.md @@ -0,0 +1,18 @@ + +# MonitorMuteCreateRequest + + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`description` | string +`target` | [MonitorMuteTargetInput](MonitorMuteTargetInput.md) +`schedule` | [MonitorMuteScheduleInput](MonitorMuteScheduleInput.md) +`filter` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteCronSchedule.md b/src/rest/generated/docs/MonitorMuteCronSchedule.md new file mode 100644 index 0000000..553ee8b --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteCronSchedule.md @@ -0,0 +1,15 @@ + +# MonitorMuteCronSchedule + + +## Properties + +Name | Type +------------ | ------------- +`rawCron` | string +`timezone` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteListResponse.md b/src/rest/generated/docs/MonitorMuteListResponse.md new file mode 100644 index 0000000..438a182 --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteListResponse.md @@ -0,0 +1,15 @@ + +# MonitorMuteListResponse + + +## Properties + +Name | Type +------------ | ------------- +`monitorMutes` | [Array<MonitorMuteResource>](MonitorMuteResource.md) +`meta` | [Meta](Meta.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteOneTime.md b/src/rest/generated/docs/MonitorMuteOneTime.md new file mode 100644 index 0000000..b217e55 --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteOneTime.md @@ -0,0 +1,16 @@ + +# MonitorMuteOneTime + +A one-time mute window. Always fully populated in responses. + +## Properties + +Name | Type +------------ | ------------- +`startTime` | string +`endTime` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteOneTimeInput.md b/src/rest/generated/docs/MonitorMuteOneTimeInput.md new file mode 100644 index 0000000..a177eca --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteOneTimeInput.md @@ -0,0 +1,16 @@ + +# MonitorMuteOneTimeInput + +Input shape for a one-time schedule. `startTime` is required. Omit `endTime` or pass `null` to create an open-ended mute. + +## Properties + +Name | Type +------------ | ------------- +`startTime` | string +`endTime` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteRecurring.md b/src/rest/generated/docs/MonitorMuteRecurring.md new file mode 100644 index 0000000..60950d1 --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteRecurring.md @@ -0,0 +1,16 @@ + +# MonitorMuteRecurring + +A recurring mute window driven by a cron schedule. + +## Properties + +Name | Type +------------ | ------------- +`cronSchedule` | [MonitorMuteCronSchedule](MonitorMuteCronSchedule.md) +`durationSeconds` | number + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteRecurringInput.md b/src/rest/generated/docs/MonitorMuteRecurringInput.md new file mode 100644 index 0000000..391f766 --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteRecurringInput.md @@ -0,0 +1,16 @@ + +# MonitorMuteRecurringInput + +Input shape for a recurring schedule. Mirrors `MonitorMute-Recurring`; kept separate so server-computed response fields can be added to the response type without widening the write contract. + +## Properties + +Name | Type +------------ | ------------- +`cronSchedule` | [MonitorMuteCronSchedule](MonitorMuteCronSchedule.md) +`durationSeconds` | number + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteResource.md b/src/rest/generated/docs/MonitorMuteResource.md new file mode 100644 index 0000000..dda0ea0 --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteResource.md @@ -0,0 +1,26 @@ + +# MonitorMuteResource + +A mute rule suppresses alert notifications during a defined time window. Use `target.kind: Global` to mute all monitors, or `target.kind: Monitors` to target a specific set. + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`label` | string +`description` | string +`target` | [MonitorMuteTarget](MonitorMuteTarget.md) +`schedule` | [MonitorMuteSchedule](MonitorMuteSchedule.md) +`filter` | string +`startTime` | string +`endTime` | string +`createdBy` | [User](User.md) +`createdAt` | string +`updatedBy` | [User](User.md) +`updatedAt` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteSchedule.md b/src/rest/generated/docs/MonitorMuteSchedule.md new file mode 100644 index 0000000..db4fd56 --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteSchedule.md @@ -0,0 +1,17 @@ + +# MonitorMuteSchedule + +Discriminated schedule. Both `oneTime` and `recurring` are always present in responses; the inactive sibling is `null`. + +## Properties + +Name | Type +------------ | ------------- +`kind` | [MonitorMuteScheduleKind](MonitorMuteScheduleKind.md) +`oneTime` | [MonitorMuteOneTime](MonitorMuteOneTime.md) +`recurring` | [MonitorMuteRecurring](MonitorMuteRecurring.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteScheduleInput.md b/src/rest/generated/docs/MonitorMuteScheduleInput.md new file mode 100644 index 0000000..fee6040 --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteScheduleInput.md @@ -0,0 +1,17 @@ + +# MonitorMuteScheduleInput + +Input shape for a schedule. `kind` is required; send only the sibling matching `kind` (`oneTime` or `recurring`). + +## Properties + +Name | Type +------------ | ------------- +`kind` | [MonitorMuteScheduleKind](MonitorMuteScheduleKind.md) +`oneTime` | [MonitorMuteOneTimeInput](MonitorMuteOneTimeInput.md) +`recurring` | [MonitorMuteRecurringInput](MonitorMuteRecurringInput.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteScheduleKind.md b/src/rest/generated/docs/MonitorMuteScheduleKind.md new file mode 100644 index 0000000..2bb64dd --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteScheduleKind.md @@ -0,0 +1,14 @@ + +# MonitorMuteScheduleKind + +`OneTime` defines a fixed window with an explicit start and optional end. `Recurring` fires on a cron schedule for a specified duration. + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteTarget.md b/src/rest/generated/docs/MonitorMuteTarget.md new file mode 100644 index 0000000..b8006a7 --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteTarget.md @@ -0,0 +1,16 @@ + +# MonitorMuteTarget + +Describes which monitors this mute rule applies to. `monitors` is always present: empty when `kind` is `Global`, non-empty when `kind` is `Monitors`. + +## Properties + +Name | Type +------------ | ------------- +`kind` | [MonitorMuteTargetKind](MonitorMuteTargetKind.md) +`monitors` | [Array<MonitorRef>](MonitorRef.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteTargetInput.md b/src/rest/generated/docs/MonitorMuteTargetInput.md new file mode 100644 index 0000000..59f9262 --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteTargetInput.md @@ -0,0 +1,16 @@ + +# MonitorMuteTargetInput + +Input shape for a mute target. `kind` is optional in PATCH — if provided it must match the existing value since `kind` is immutable after creation. `monitors` is required and non-empty when `kind` is `Monitors`; omit or leave empty when `kind` is `Global`. + +## Properties + +Name | Type +------------ | ------------- +`kind` | [MonitorMuteTargetKind](MonitorMuteTargetKind.md) +`monitors` | [Array<MonitorRef>](MonitorRef.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteTargetKind.md b/src/rest/generated/docs/MonitorMuteTargetKind.md new file mode 100644 index 0000000..1ff5943 --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteTargetKind.md @@ -0,0 +1,14 @@ + +# MonitorMuteTargetKind + +`Global` suppresses all monitors (requires a non-empty `filter`). `Monitors` targets a specific set of monitors by ID. + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorMuteUpdateRequest.md b/src/rest/generated/docs/MonitorMuteUpdateRequest.md new file mode 100644 index 0000000..83d8cfc --- /dev/null +++ b/src/rest/generated/docs/MonitorMuteUpdateRequest.md @@ -0,0 +1,19 @@ + +# MonitorMuteUpdateRequest + +All fields are optional. Omitted fields are left unchanged. Sending a `target` object replaces the entire target subtree atomically; `target.kind` must match the existing value (it is immutable). Send `filter: null` to remove an existing filter. + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`description` | string +`target` | [MonitorMuteTargetInput](MonitorMuteTargetInput.md) +`schedule` | [MonitorMuteScheduleInput](MonitorMuteScheduleInput.md) +`filter` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorRef.md b/src/rest/generated/docs/MonitorRef.md new file mode 100644 index 0000000..74b9091 --- /dev/null +++ b/src/rest/generated/docs/MonitorRef.md @@ -0,0 +1,16 @@ + +# MonitorRef + +Reference to a monitor. Always carries the `id`. The `record` field is populated with brief metadata only when `expand=true`. + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`record` | [MonitorBrief](MonitorBrief.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2.md b/src/rest/generated/docs/MonitorV2.md new file mode 100644 index 0000000..e66653f --- /dev/null +++ b/src/rest/generated/docs/MonitorV2.md @@ -0,0 +1,20 @@ + +# MonitorV2 + + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`name` | string +`disabled` | boolean +`ruleKind` | [MonitorV2RuleKind](MonitorV2RuleKind.md) +`definition` | [MonitorV2Definition](MonitorV2Definition.md) +`actionRules` | [Array<MonitorV2ActionRule>](MonitorV2ActionRule.md) +`effectiveScheduling` | [MonitorV2Scheduling](MonitorV2Scheduling.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2ActionDefinition.md b/src/rest/generated/docs/MonitorV2ActionDefinition.md new file mode 100644 index 0000000..f3b564d --- /dev/null +++ b/src/rest/generated/docs/MonitorV2ActionDefinition.md @@ -0,0 +1,17 @@ + +# MonitorV2ActionDefinition + + +## Properties + +Name | Type +------------ | ------------- +`inline` | boolean +`type` | [MonitorV2ActionType](MonitorV2ActionType.md) +`email` | [MonitorV2EmailAction](MonitorV2EmailAction.md) +`webhook` | [MonitorV2WebhookAction](MonitorV2WebhookAction.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2ActionRule.md b/src/rest/generated/docs/MonitorV2ActionRule.md new file mode 100644 index 0000000..d0518bb --- /dev/null +++ b/src/rest/generated/docs/MonitorV2ActionRule.md @@ -0,0 +1,20 @@ + +# MonitorV2ActionRule + +Either the actionId or the definition must be present when setting. The actionId references an existing shared action, while the definition would be used to configure an inline (private to a monitor) action. + +## Properties + +Name | Type +------------ | ------------- +`actionId` | string +`levels` | [MonitorV2AlarmLevel](MonitorV2AlarmLevel.md) +`conditions` | [MonitorV2ComparisonExpression](MonitorV2ComparisonExpression.md) +`sendEndNotifications` | boolean +`sendRemindersInterval` | boolean +`definition` | [MonitorV2ActionDefinition](MonitorV2ActionDefinition.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2ActionType.md b/src/rest/generated/docs/MonitorV2ActionType.md new file mode 100644 index 0000000..f144df7 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2ActionType.md @@ -0,0 +1,13 @@ + +# MonitorV2ActionType + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2AlarmLevel.md b/src/rest/generated/docs/MonitorV2AlarmLevel.md new file mode 100644 index 0000000..8d98ce7 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2AlarmLevel.md @@ -0,0 +1,13 @@ + +# MonitorV2AlarmLevel + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2BooleanOperator.md b/src/rest/generated/docs/MonitorV2BooleanOperator.md new file mode 100644 index 0000000..ee922b7 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2BooleanOperator.md @@ -0,0 +1,13 @@ + +# MonitorV2BooleanOperator + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2Column.md b/src/rest/generated/docs/MonitorV2Column.md new file mode 100644 index 0000000..e35b54c --- /dev/null +++ b/src/rest/generated/docs/MonitorV2Column.md @@ -0,0 +1,17 @@ + +# MonitorV2Column + +Identifies a column in a monitor\'s input pipeline. At most one of `linkColumn`, `columnPath`, and `correlationTag` may be set; the save-time validator rejects violations of this one-of contract. + +## Properties + +Name | Type +------------ | ------------- +`linkColumn` | [MonitorV2LinkColumn](MonitorV2LinkColumn.md) +`columnPath` | [MonitorV2ColumnPath](MonitorV2ColumnPath.md) +`correlationTag` | [MonitorV2CorrelationTag](MonitorV2CorrelationTag.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2ColumnComparison.md b/src/rest/generated/docs/MonitorV2ColumnComparison.md new file mode 100644 index 0000000..d6d48bf --- /dev/null +++ b/src/rest/generated/docs/MonitorV2ColumnComparison.md @@ -0,0 +1,15 @@ + +# MonitorV2ColumnComparison + + +## Properties + +Name | Type +------------ | ------------- +`compareValues` | [Array<MonitorV2Comparison>](MonitorV2Comparison.md) +`column` | [MonitorV2Column](MonitorV2Column.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2ColumnPath.md b/src/rest/generated/docs/MonitorV2ColumnPath.md new file mode 100644 index 0000000..21232e2 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2ColumnPath.md @@ -0,0 +1,15 @@ + +# MonitorV2ColumnPath + + +## Properties + +Name | Type +------------ | ------------- +`name` | string +`path` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2Comparison.md b/src/rest/generated/docs/MonitorV2Comparison.md new file mode 100644 index 0000000..845b65d --- /dev/null +++ b/src/rest/generated/docs/MonitorV2Comparison.md @@ -0,0 +1,15 @@ + +# MonitorV2Comparison + + +## Properties + +Name | Type +------------ | ------------- +`compareFn` | [MonitorV2ComparisonFunction](MonitorV2ComparisonFunction.md) +`compareValue` | [PrimitiveValue](PrimitiveValue.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2ComparisonExpression.md b/src/rest/generated/docs/MonitorV2ComparisonExpression.md new file mode 100644 index 0000000..3992280 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2ComparisonExpression.md @@ -0,0 +1,16 @@ + +# MonitorV2ComparisonExpression + + +## Properties + +Name | Type +------------ | ------------- +`operator` | [MonitorV2BooleanOperator](MonitorV2BooleanOperator.md) +`subExpressions` | [Array<MonitorV2ComparisonExpression>](MonitorV2ComparisonExpression.md) +`compareTerms` | [Array<MonitorV2ComparisonTerm>](MonitorV2ComparisonTerm.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2ComparisonFunction.md b/src/rest/generated/docs/MonitorV2ComparisonFunction.md new file mode 100644 index 0000000..1016a03 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2ComparisonFunction.md @@ -0,0 +1,13 @@ + +# MonitorV2ComparisonFunction + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2ComparisonTerm.md b/src/rest/generated/docs/MonitorV2ComparisonTerm.md new file mode 100644 index 0000000..19b078c --- /dev/null +++ b/src/rest/generated/docs/MonitorV2ComparisonTerm.md @@ -0,0 +1,15 @@ + +# MonitorV2ComparisonTerm + + +## Properties + +Name | Type +------------ | ------------- +`comparison` | [MonitorV2Comparison](MonitorV2Comparison.md) +`column` | [MonitorV2Column](MonitorV2Column.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2CorrelationTag.md b/src/rest/generated/docs/MonitorV2CorrelationTag.md new file mode 100644 index 0000000..69fc994 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2CorrelationTag.md @@ -0,0 +1,15 @@ + +# MonitorV2CorrelationTag + +Marker on a `MonitorV2Column` indicating that the column is grouping by a correlation tag (e.g. `service.name`) rather than a specific physical column. The per-column struct is a slim marker that only carries the tag name; the resolved `(tag, backing-column)` mapping for every correlation tag in the schema lives on `MonitorV2AlertSchema.correlationTags`, which is the single source of truth for tag-to-column resolution. + +## Properties + +Name | Type +------------ | ------------- +`tag` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2CountRule.md b/src/rest/generated/docs/MonitorV2CountRule.md new file mode 100644 index 0000000..de1c0e6 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2CountRule.md @@ -0,0 +1,15 @@ + +# MonitorV2CountRule + + +## Properties + +Name | Type +------------ | ------------- +`compareValues` | [Array<MonitorV2Comparison>](MonitorV2Comparison.md) +`compareGroups` | [Array<MonitorV2ColumnComparison>](MonitorV2ColumnComparison.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2CronSchedule.md b/src/rest/generated/docs/MonitorV2CronSchedule.md new file mode 100644 index 0000000..6cccf0e --- /dev/null +++ b/src/rest/generated/docs/MonitorV2CronSchedule.md @@ -0,0 +1,16 @@ + +# MonitorV2CronSchedule + + +## Properties + +Name | Type +------------ | ------------- +`cronConfig` | string +`timezone` | string +`alarmMode` | [MonitorV2CronScheduleAlarmMode](MonitorV2CronScheduleAlarmMode.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2CronScheduleAlarmMode.md b/src/rest/generated/docs/MonitorV2CronScheduleAlarmMode.md new file mode 100644 index 0000000..6609414 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2CronScheduleAlarmMode.md @@ -0,0 +1,14 @@ + +# MonitorV2CronScheduleAlarmMode + +Controls how alarms are emitted across consecutive monitor evaluations. PerRun (the default when omitted) emits an independent zero-duration alarm per firing evaluation. Ongoing causes consecutive evaluations that re-assert the same (group, level) to extend a single ongoing alarm. Setting the value to Ongoing is gated by a customer feature flag. + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2Definition.md b/src/rest/generated/docs/MonitorV2Definition.md new file mode 100644 index 0000000..073deb7 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2Definition.md @@ -0,0 +1,20 @@ + +# MonitorV2Definition + + +## Properties + +Name | Type +------------ | ------------- +`inputQuery` | [MultiStageQuery](MultiStageQuery.md) +`rules` | [Array<MonitorV2Rule>](MonitorV2Rule.md) +`lookbackTime` | string +`dataStabilizationDelay` | string +`maxAlertsPerHour` | number +`groupings` | [Array<MonitorV2Column>](MonitorV2Column.md) +`scheduling` | [MonitorV2Scheduling](MonitorV2Scheduling.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2EmailAction.md b/src/rest/generated/docs/MonitorV2EmailAction.md new file mode 100644 index 0000000..f4a5c0c --- /dev/null +++ b/src/rest/generated/docs/MonitorV2EmailAction.md @@ -0,0 +1,18 @@ + +# MonitorV2EmailAction + + +## Properties + +Name | Type +------------ | ------------- +`users` | Array<string> +`addresses` | Array<string> +`subject` | string +`body` | string +`fragments` | object + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2HttpType.md b/src/rest/generated/docs/MonitorV2HttpType.md new file mode 100644 index 0000000..19c45bc --- /dev/null +++ b/src/rest/generated/docs/MonitorV2HttpType.md @@ -0,0 +1,14 @@ + +# MonitorV2HttpType + +The http type describes the method or verb to use in http webhooks. note: As a convenience, the values POST and PUT will be accepted, but converted to the enumeration values Post and Put respectively. + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2LinkColumn.md b/src/rest/generated/docs/MonitorV2LinkColumn.md new file mode 100644 index 0000000..1b37878 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2LinkColumn.md @@ -0,0 +1,15 @@ + +# MonitorV2LinkColumn + + +## Properties + +Name | Type +------------ | ------------- +`name` | string +`meta` | [MonitorV2LinkColumnMeta](MonitorV2LinkColumnMeta.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2LinkColumnMeta.md b/src/rest/generated/docs/MonitorV2LinkColumnMeta.md new file mode 100644 index 0000000..abd8b72 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2LinkColumnMeta.md @@ -0,0 +1,16 @@ + +# MonitorV2LinkColumnMeta + + +## Properties + +Name | Type +------------ | ------------- +`srcFields` | [Array<MonitorV2ColumnPath>](MonitorV2ColumnPath.md) +`dstFields` | Array<string> +`targetDataset` | Array<string> + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2MuteRule.md b/src/rest/generated/docs/MonitorV2MuteRule.md new file mode 100644 index 0000000..02ef9ae --- /dev/null +++ b/src/rest/generated/docs/MonitorV2MuteRule.md @@ -0,0 +1,23 @@ + +# MonitorV2MuteRule + + +## Properties + +Name | Type +------------ | ------------- +`schedule` | [MonitorV2MuteRuleSchedule](MonitorV2MuteRuleSchedule.md) +`criteria` | [MonitorV2ComparisonExpression](MonitorV2ComparisonExpression.md) +`validFrom` | string +`validTo` | string +`monitorID` | string +`monitor` | [MonitorV2MuteRuleMonitor](MonitorV2MuteRuleMonitor.md) +`id` | string +`name` | string +`isGlobal` | boolean +`isConditional` | boolean + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2MuteRuleMonitor.md b/src/rest/generated/docs/MonitorV2MuteRuleMonitor.md new file mode 100644 index 0000000..90b6885 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2MuteRuleMonitor.md @@ -0,0 +1,15 @@ + +# MonitorV2MuteRuleMonitor + + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`name` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2MuteRuleSchedule.md b/src/rest/generated/docs/MonitorV2MuteRuleSchedule.md new file mode 100644 index 0000000..35ec1af --- /dev/null +++ b/src/rest/generated/docs/MonitorV2MuteRuleSchedule.md @@ -0,0 +1,15 @@ + +# MonitorV2MuteRuleSchedule + + +## Properties + +Name | Type +------------ | ------------- +`type` | [MonitorV2MuteScheduleType](MonitorV2MuteScheduleType.md) +`oneTime` | [MonitorV2OneTimeMuteSchedule](MonitorV2OneTimeMuteSchedule.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2MuteRuleScheduleTerse.md b/src/rest/generated/docs/MonitorV2MuteRuleScheduleTerse.md new file mode 100644 index 0000000..346ef4f --- /dev/null +++ b/src/rest/generated/docs/MonitorV2MuteRuleScheduleTerse.md @@ -0,0 +1,14 @@ + +# MonitorV2MuteRuleScheduleTerse + + +## Properties + +Name | Type +------------ | ------------- +`type` | [MonitorV2MuteScheduleType](MonitorV2MuteScheduleType.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2MuteRuleTerse.md b/src/rest/generated/docs/MonitorV2MuteRuleTerse.md new file mode 100644 index 0000000..923977b --- /dev/null +++ b/src/rest/generated/docs/MonitorV2MuteRuleTerse.md @@ -0,0 +1,21 @@ + +# MonitorV2MuteRuleTerse + + +## Properties + +Name | Type +------------ | ------------- +`schedule` | [MonitorV2MuteRuleScheduleTerse](MonitorV2MuteRuleScheduleTerse.md) +`validFrom` | string +`validTo` | string +`monitorID` | string +`id` | string +`name` | string +`isGlobal` | boolean +`isConditional` | boolean + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2MuteScheduleType.md b/src/rest/generated/docs/MonitorV2MuteScheduleType.md new file mode 100644 index 0000000..7c5dcfa --- /dev/null +++ b/src/rest/generated/docs/MonitorV2MuteScheduleType.md @@ -0,0 +1,13 @@ + +# MonitorV2MuteScheduleType + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2OneTimeMuteSchedule.md b/src/rest/generated/docs/MonitorV2OneTimeMuteSchedule.md new file mode 100644 index 0000000..48d24ac --- /dev/null +++ b/src/rest/generated/docs/MonitorV2OneTimeMuteSchedule.md @@ -0,0 +1,15 @@ + +# MonitorV2OneTimeMuteSchedule + + +## Properties + +Name | Type +------------ | ------------- +`startTime` | string +`endTime` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2PatchRequest.md b/src/rest/generated/docs/MonitorV2PatchRequest.md new file mode 100644 index 0000000..2209d86 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2PatchRequest.md @@ -0,0 +1,20 @@ + +# MonitorV2PatchRequest + +Request body for `PATCH .../monitors/{id}`. Every property is optional. Only these top-level keys participate in the update; see the operation description for merge vs whole-value replacement rules. + +## Properties + +Name | Type +------------ | ------------- +`name` | string +`disabled` | boolean +`description` | string +`ruleKind` | [MonitorV2RuleKind](MonitorV2RuleKind.md) +`definition` | [MonitorV2Definition](MonitorV2Definition.md) +`actionRules` | [Array<MonitorV2ActionRule>](MonitorV2ActionRule.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2PromoteRule.md b/src/rest/generated/docs/MonitorV2PromoteRule.md new file mode 100644 index 0000000..1168843 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2PromoteRule.md @@ -0,0 +1,14 @@ + +# MonitorV2PromoteRule + + +## Properties + +Name | Type +------------ | ------------- +`compareColumns` | [Array<MonitorV2ColumnComparison>](MonitorV2ColumnComparison.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2Rule.md b/src/rest/generated/docs/MonitorV2Rule.md new file mode 100644 index 0000000..3656660 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2Rule.md @@ -0,0 +1,17 @@ + +# MonitorV2Rule + + +## Properties + +Name | Type +------------ | ------------- +`level` | [MonitorV2AlarmLevel](MonitorV2AlarmLevel.md) +`count` | [MonitorV2CountRule](MonitorV2CountRule.md) +`threshold` | [MonitorV2ThresholdRule](MonitorV2ThresholdRule.md) +`promote` | [MonitorV2PromoteRule](MonitorV2PromoteRule.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2RuleKind.md b/src/rest/generated/docs/MonitorV2RuleKind.md new file mode 100644 index 0000000..6a9922c --- /dev/null +++ b/src/rest/generated/docs/MonitorV2RuleKind.md @@ -0,0 +1,13 @@ + +# MonitorV2RuleKind + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2Scheduling.md b/src/rest/generated/docs/MonitorV2Scheduling.md new file mode 100644 index 0000000..ea074a2 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2Scheduling.md @@ -0,0 +1,16 @@ + +# MonitorV2Scheduling + +Scheduling modes are mutually exclusive. Omit both transform and scheduled for service-chosen defaults. Set transform for continuous transform-driven evaluation, or scheduled for cron-based wall-clock evaluation. + +## Properties + +Name | Type +------------ | ------------- +`transform` | [MonitorV2TransformSchedule](MonitorV2TransformSchedule.md) +`scheduled` | [MonitorV2CronSchedule](MonitorV2CronSchedule.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2Terse.md b/src/rest/generated/docs/MonitorV2Terse.md new file mode 100644 index 0000000..eb240fc --- /dev/null +++ b/src/rest/generated/docs/MonitorV2Terse.md @@ -0,0 +1,19 @@ + +# MonitorV2Terse + + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`name` | string +`description` | string +`disabled` | boolean +`monitorVersion` | number +`ruleKind` | [MonitorV2RuleKind](MonitorV2RuleKind.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2ThresholdRule.md b/src/rest/generated/docs/MonitorV2ThresholdRule.md new file mode 100644 index 0000000..01544a8 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2ThresholdRule.md @@ -0,0 +1,17 @@ + +# MonitorV2ThresholdRule + + +## Properties + +Name | Type +------------ | ------------- +`compareValues` | [Array<MonitorV2Comparison>](MonitorV2Comparison.md) +`valueColumnName` | string +`aggregation` | [MonitorV2ValueAggregation](MonitorV2ValueAggregation.md) +`compareGroups` | [Array<MonitorV2ColumnComparison>](MonitorV2ColumnComparison.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2TransformSchedule.md b/src/rest/generated/docs/MonitorV2TransformSchedule.md new file mode 100644 index 0000000..06055c9 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2TransformSchedule.md @@ -0,0 +1,14 @@ + +# MonitorV2TransformSchedule + + +## Properties + +Name | Type +------------ | ------------- +`freshnessGoal` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2ValueAggregation.md b/src/rest/generated/docs/MonitorV2ValueAggregation.md new file mode 100644 index 0000000..843e435 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2ValueAggregation.md @@ -0,0 +1,13 @@ + +# MonitorV2ValueAggregation + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2WebhookAction.md b/src/rest/generated/docs/MonitorV2WebhookAction.md new file mode 100644 index 0000000..546e01e --- /dev/null +++ b/src/rest/generated/docs/MonitorV2WebhookAction.md @@ -0,0 +1,18 @@ + +# MonitorV2WebhookAction + + +## Properties + +Name | Type +------------ | ------------- +`url` | string +`method` | [MonitorV2HttpType](MonitorV2HttpType.md) +`headers` | [Array<MonitorV2WebhookHeader>](MonitorV2WebhookHeader.md) +`body` | string +`fragments` | object + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MonitorV2WebhookHeader.md b/src/rest/generated/docs/MonitorV2WebhookHeader.md new file mode 100644 index 0000000..80bd265 --- /dev/null +++ b/src/rest/generated/docs/MonitorV2WebhookHeader.md @@ -0,0 +1,15 @@ + +# MonitorV2WebhookHeader + + +## Properties + +Name | Type +------------ | ------------- +`header` | string +`value` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/MultiStageQuery.md b/src/rest/generated/docs/MultiStageQuery.md new file mode 100644 index 0000000..1f2f0df --- /dev/null +++ b/src/rest/generated/docs/MultiStageQuery.md @@ -0,0 +1,15 @@ + +# MultiStageQuery + + +## Properties + +Name | Type +------------ | ------------- +`outputStage` | string +`stages` | [Array<StageQuery>](StageQuery.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/OAuthExternalIntegrationRef.md b/src/rest/generated/docs/OAuthExternalIntegrationRef.md new file mode 100644 index 0000000..21211d9 --- /dev/null +++ b/src/rest/generated/docs/OAuthExternalIntegrationRef.md @@ -0,0 +1,14 @@ + +# OAuthExternalIntegrationRef + + +## Properties + +Name | Type +------------ | ------------- +`id` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ObjectBrief.md b/src/rest/generated/docs/ObjectBrief.md new file mode 100644 index 0000000..5a7ef3f --- /dev/null +++ b/src/rest/generated/docs/ObjectBrief.md @@ -0,0 +1,18 @@ + +# ObjectBrief + +Brief record fields for an ObjectRef. This type is polymorphic: additional fields pointing to specific object types (e.g. dataset, dashboard, monitor) may be added in the future as needed. + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`description` | string +`iconUrl` | string +`managedBy` | [ObjectRef](ObjectRef.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ObjectRef.md b/src/rest/generated/docs/ObjectRef.md new file mode 100644 index 0000000..7b1c516 --- /dev/null +++ b/src/rest/generated/docs/ObjectRef.md @@ -0,0 +1,16 @@ + +# ObjectRef + +A reference to another resource. Always carries the id; the optional `record` field carries the brief metadata, populated when expand=true. Brief expansion applies to one layer only — fields inside `record` that are themselves ObjectRefs (e.g. `record.managedBy`) are returned id-only, never with their own `record` populated. CEL filter expressions can deeper-resolve via lazy wrapper resolution if needed. + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`record` | [ObjectBrief](ObjectBrief.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/OpenTimeRange.md b/src/rest/generated/docs/OpenTimeRange.md new file mode 100644 index 0000000..d8cdece --- /dev/null +++ b/src/rest/generated/docs/OpenTimeRange.md @@ -0,0 +1,16 @@ + +# OpenTimeRange + +A time range with a start and/or end time. + +## Properties + +Name | Type +------------ | ------------- +`startTime` | string +`endTime` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ParameterArrayInner.md b/src/rest/generated/docs/ParameterArrayInner.md new file mode 100644 index 0000000..3858110 --- /dev/null +++ b/src/rest/generated/docs/ParameterArrayInner.md @@ -0,0 +1,17 @@ + +# ParameterArrayInner + + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`name` | string +`defaultValue` | [ParameterArrayInnerDefaultValue](ParameterArrayInnerDefaultValue.md) +`valueKind` | [ParameterArrayInnerValueKind](ParameterArrayInnerValueKind.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ParameterArrayInnerDefaultValue.md b/src/rest/generated/docs/ParameterArrayInnerDefaultValue.md new file mode 100644 index 0000000..fa83b53 --- /dev/null +++ b/src/rest/generated/docs/ParameterArrayInnerDefaultValue.md @@ -0,0 +1,20 @@ + +# ParameterArrayInnerDefaultValue + + +## Properties + +Name | Type +------------ | ------------- +`bool` | boolean +`float64` | number +`int64` | string +`string` | string +`timestamp` | string +`duration` | string +`nullValueType` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ParameterArrayInnerValueKind.md b/src/rest/generated/docs/ParameterArrayInnerValueKind.md new file mode 100644 index 0000000..784504c --- /dev/null +++ b/src/rest/generated/docs/ParameterArrayInnerValueKind.md @@ -0,0 +1,14 @@ + +# ParameterArrayInnerValueKind + + +## Properties + +Name | Type +------------ | ------------- +`type` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ParameterValueArrayInner.md b/src/rest/generated/docs/ParameterValueArrayInner.md new file mode 100644 index 0000000..0cdaa73 --- /dev/null +++ b/src/rest/generated/docs/ParameterValueArrayInner.md @@ -0,0 +1,15 @@ + +# ParameterValueArrayInner + + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`value` | [ParameterArrayInnerDefaultValue](ParameterArrayInnerDefaultValue.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/PollDelegatedLogin200Response.md b/src/rest/generated/docs/PollDelegatedLogin200Response.md new file mode 100644 index 0000000..94c3685 --- /dev/null +++ b/src/rest/generated/docs/PollDelegatedLogin200Response.md @@ -0,0 +1,17 @@ + +# PollDelegatedLogin200Response + + +## Properties + +Name | Type +------------ | ------------- +`ok` | boolean +`settled` | boolean +`accessKey` | string +`message` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/PrimitiveValue.md b/src/rest/generated/docs/PrimitiveValue.md new file mode 100644 index 0000000..9edc649 --- /dev/null +++ b/src/rest/generated/docs/PrimitiveValue.md @@ -0,0 +1,22 @@ + +# PrimitiveValue + + +## Properties + +Name | Type +------------ | ------------- +`bool` | boolean +`float64` | number +`int64` | string +`string` | string +`timestamp` | string +`duration` | string +`array` | [Array<PrimitiveValue>](PrimitiveValue.md) +`link` | [PrimitiveValueLink](PrimitiveValueLink.md) +`datasetref` | [PrimitiveValueDatasetref](PrimitiveValueDatasetref.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/PrimitiveValueDatasetref.md b/src/rest/generated/docs/PrimitiveValueDatasetref.md new file mode 100644 index 0000000..546fc2c --- /dev/null +++ b/src/rest/generated/docs/PrimitiveValueDatasetref.md @@ -0,0 +1,16 @@ + +# PrimitiveValueDatasetref + + +## Properties + +Name | Type +------------ | ------------- +`datasetId` | string +`datasetPath` | string +`stageId` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/PrimitiveValueLink.md b/src/rest/generated/docs/PrimitiveValueLink.md new file mode 100644 index 0000000..c3e4559 --- /dev/null +++ b/src/rest/generated/docs/PrimitiveValueLink.md @@ -0,0 +1,16 @@ + +# PrimitiveValueLink + + +## Properties + +Name | Type +------------ | ------------- +`datasetId` | string +`primaryKeyValue` | [Array<PrimitiveValueLinkPrimaryKeyValueInner>](PrimitiveValueLinkPrimaryKeyValueInner.md) +`storedLabel` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/PrimitiveValueLinkPrimaryKeyValueInner.md b/src/rest/generated/docs/PrimitiveValueLinkPrimaryKeyValueInner.md new file mode 100644 index 0000000..5862d97 --- /dev/null +++ b/src/rest/generated/docs/PrimitiveValueLinkPrimaryKeyValueInner.md @@ -0,0 +1,14 @@ + +# PrimitiveValueLinkPrimaryKeyValueInner + + +## Properties + +Name | Type +------------ | ------------- +`name` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/QueryReferenceTables200Response.md b/src/rest/generated/docs/QueryReferenceTables200Response.md new file mode 100644 index 0000000..69e5a90 --- /dev/null +++ b/src/rest/generated/docs/QueryReferenceTables200Response.md @@ -0,0 +1,15 @@ + +# QueryReferenceTables200Response + + +## Properties + +Name | Type +------------ | ------------- +`totalCount` | number +`referenceTables` | [Array<ReferenceTablesTable>](ReferenceTablesTable.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/RbacGroupRef.md b/src/rest/generated/docs/RbacGroupRef.md new file mode 100644 index 0000000..445a9bb --- /dev/null +++ b/src/rest/generated/docs/RbacGroupRef.md @@ -0,0 +1,18 @@ + +# RbacGroupRef + +Reference to an RBAC group, including id, label, and description. + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`legacyId` | string +`label` | string +`description` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ReferenceTablesApi.md b/src/rest/generated/docs/ReferenceTablesApi.md new file mode 100644 index 0000000..b7099cb --- /dev/null +++ b/src/rest/generated/docs/ReferenceTablesApi.md @@ -0,0 +1,502 @@ +# ReferenceTablesApi + +All URIs are relative to *https://OBSERVE_CUSTOMERID.observeinc.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createReferenceTable**](ReferenceTablesApi.md#createreferencetable) | **POST** /v1/referencetables | Create a new reference table | +| [**deleteReferenceTable**](ReferenceTablesApi.md#deletereferencetable) | **DELETE** /v1/referencetables/{id} | Delete a reference table | +| [**getReferenceTable**](ReferenceTablesApi.md#getreferencetable) | **GET** /v1/referencetables/{id} | Get a reference table | +| [**queryReferenceTables**](ReferenceTablesApi.md#queryreferencetables) | **GET** /v1/referencetables | Query reference tables | +| [**updateReferenceTable**](ReferenceTablesApi.md#updatereferencetable) | **PUT** /v1/referencetables/{id} | Replace a reference table | +| [**updateReferenceTableMetadata**](ReferenceTablesApi.md#updatereferencetablemetadata) | **PATCH** /v1/referencetables/{id} | Update metadata of a reference table | + + + +## createReferenceTable + +> ReferenceTablesTable createReferenceTable(metadata, upload, schema) + +Create a new reference table + +Creates a new reference table with the specified parameters and uploaded data. + +### Example + +```ts +import { + Configuration, + ReferenceTablesApi, +} from ''; +import type { CreateReferenceTableRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ReferenceTablesApi(config); + + const body = { + // ReferenceTablesTableMetadata (optional) + metadata: ..., + // Blob | CSV file containing the data (optional) + upload: BINARY_DATA_HERE, + // Blob | JSON file specifying the schema (optional) (optional) + schema: BINARY_DATA_HERE, + } satisfies CreateReferenceTableRequest; + + try { + const data = await api.createReferenceTable(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **metadata** | [ReferenceTablesTableMetadata](ReferenceTablesTableMetadata.md) | | [Optional] [Defaults to `undefined`] | +| **upload** | `Blob` | CSV file containing the data | [Optional] [Defaults to `undefined`] | +| **schema** | `Blob` | JSON file specifying the schema (optional) | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ReferenceTablesTable**](ReferenceTablesTable.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Successfully created reference table | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteReferenceTable + +> UpdateReferenceTable200Response deleteReferenceTable(id) + +Delete a reference table + +Deletes a reference table with the specified ID. + +### Example + +```ts +import { + Configuration, + ReferenceTablesApi, +} from ''; +import type { DeleteReferenceTableRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ReferenceTablesApi(config); + + const body = { + // string + id: id_example, + } satisfies DeleteReferenceTableRequest; + + try { + const data = await api.deleteReferenceTable(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | | [Defaults to `undefined`] | + +### Return type + +[**UpdateReferenceTable200Response**](UpdateReferenceTable200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully deleted reference table | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getReferenceTable + +> ReferenceTablesTable getReferenceTable(id) + +Get a reference table + +Retrieve a specific reference table by ID. + +### Example + +```ts +import { + Configuration, + ReferenceTablesApi, +} from ''; +import type { GetReferenceTableRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ReferenceTablesApi(config); + + const body = { + // string + id: id_example, + } satisfies GetReferenceTableRequest; + + try { + const data = await api.getReferenceTable(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | | [Defaults to `undefined`] | + +### Return type + +[**ReferenceTablesTable**](ReferenceTablesTable.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully retrieved reference table | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## queryReferenceTables + +> QueryReferenceTables200Response queryReferenceTables(label, createdBy, limit, offset) + +Query reference tables + +Search for reference tables with optional filters (label, createdBy) and pagination. + +### Example + +```ts +import { + Configuration, + ReferenceTablesApi, +} from ''; +import type { QueryReferenceTablesRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ReferenceTablesApi(config); + + const body = { + // string | Name of the reference table to search for (supports substring match). (optional) + label: label_example, + // string | Filter by the user who created the reference tables. (optional) + createdBy: createdBy_example, + // number | The maximum number of items to return per page. (optional) + limit: 56, + // number | The index of the first item to return (pagination offset). (optional) + offset: 56, + } satisfies QueryReferenceTablesRequest; + + try { + const data = await api.queryReferenceTables(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **label** | `string` | Name of the reference table to search for (supports substring match). | [Optional] [Defaults to `undefined`] | +| **createdBy** | `string` | Filter by the user who created the reference tables. | [Optional] [Defaults to `undefined`] | +| **limit** | `number` | The maximum number of items to return per page. | [Optional] [Defaults to `100`] | +| **offset** | `number` | The index of the first item to return (pagination offset). | [Optional] [Defaults to `0`] | + +### Return type + +[**QueryReferenceTables200Response**](QueryReferenceTables200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully queried reference tables | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateReferenceTable + +> UpdateReferenceTable200Response updateReferenceTable(id, metadata, upload, schema) + +Replace a reference table + +Replaces a reference table with the specified ID. + +### Example + +```ts +import { + Configuration, + ReferenceTablesApi, +} from ''; +import type { UpdateReferenceTableRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ReferenceTablesApi(config); + + const body = { + // string + id: id_example, + // ReferenceTablesTableMetadata (optional) + metadata: ..., + // Blob | CSV file containing the data (optional) + upload: BINARY_DATA_HERE, + // Blob | JSON file specifying the schema (optional) (optional) + schema: BINARY_DATA_HERE, + } satisfies UpdateReferenceTableRequest; + + try { + const data = await api.updateReferenceTable(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | | [Defaults to `undefined`] | +| **metadata** | [ReferenceTablesTableMetadata](ReferenceTablesTableMetadata.md) | | [Optional] [Defaults to `undefined`] | +| **upload** | `Blob` | CSV file containing the data | [Optional] [Defaults to `undefined`] | +| **schema** | `Blob` | JSON file specifying the schema (optional) | [Optional] [Defaults to `undefined`] | + +### Return type + +[**UpdateReferenceTable200Response**](UpdateReferenceTable200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully replaced reference table | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateReferenceTableMetadata + +> ReferenceTablesTable updateReferenceTableMetadata(id, referenceTablesTableMetadataPatch) + +Update metadata of a reference table + +Updates the metadata of a reference table with the specified ID. + +### Example + +```ts +import { + Configuration, + ReferenceTablesApi, +} from ''; +import type { UpdateReferenceTableMetadataRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ReferenceTablesApi(config); + + const body = { + // string + id: id_example, + // ReferenceTablesTableMetadataPatch + referenceTablesTableMetadataPatch: ..., + } satisfies UpdateReferenceTableMetadataRequest; + + try { + const data = await api.updateReferenceTableMetadata(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | | [Defaults to `undefined`] | +| **referenceTablesTableMetadataPatch** | [ReferenceTablesTableMetadataPatch](ReferenceTablesTableMetadataPatch.md) | | | + +### Return type + +[**ReferenceTablesTable**](ReferenceTablesTable.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully updated reference table metadata | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/src/rest/generated/docs/ReferenceTablesTable.md b/src/rest/generated/docs/ReferenceTablesTable.md new file mode 100644 index 0000000..ecaa571 --- /dev/null +++ b/src/rest/generated/docs/ReferenceTablesTable.md @@ -0,0 +1,28 @@ + +# ReferenceTablesTable + + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`label` | string +`description` | string +`iconUrl` | string +`managedById` | string +`customerId` | string +`createdAt` | string +`createdBy` | [User](User.md) +`updatedAt` | string +`updatedBy` | [User](User.md) +`datasetId` | string +`checksum` | string +`schema` | [Array<ReferenceTablesTableSchemaInner>](ReferenceTablesTableSchemaInner.md) +`primaryKey` | Array<string> +`labelField` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ReferenceTablesTableMetadata.md b/src/rest/generated/docs/ReferenceTablesTableMetadata.md new file mode 100644 index 0000000..0686d2c --- /dev/null +++ b/src/rest/generated/docs/ReferenceTablesTableMetadata.md @@ -0,0 +1,17 @@ + +# ReferenceTablesTableMetadata + + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`description` | string +`primaryKey` | Array<string> +`labelField` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ReferenceTablesTableMetadataPatch.md b/src/rest/generated/docs/ReferenceTablesTableMetadataPatch.md new file mode 100644 index 0000000..5e72a4c --- /dev/null +++ b/src/rest/generated/docs/ReferenceTablesTableMetadataPatch.md @@ -0,0 +1,15 @@ + +# ReferenceTablesTableMetadataPatch + + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`description` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ReferenceTablesTableSchemaInner.md b/src/rest/generated/docs/ReferenceTablesTableSchemaInner.md new file mode 100644 index 0000000..56b113c --- /dev/null +++ b/src/rest/generated/docs/ReferenceTablesTableSchemaInner.md @@ -0,0 +1,15 @@ + +# ReferenceTablesTableSchemaInner + + +## Properties + +Name | Type +------------ | ------------- +`name` | string +`type` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ServiceAccountCreateRequest.md b/src/rest/generated/docs/ServiceAccountCreateRequest.md new file mode 100644 index 0000000..dcc4ae4 --- /dev/null +++ b/src/rest/generated/docs/ServiceAccountCreateRequest.md @@ -0,0 +1,16 @@ + +# ServiceAccountCreateRequest + + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`description` | string +`externalOAuth` | [ServiceAccountExternalOAuth](ServiceAccountExternalOAuth.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ServiceAccountExternalOAuth.md b/src/rest/generated/docs/ServiceAccountExternalOAuth.md new file mode 100644 index 0000000..117d118 --- /dev/null +++ b/src/rest/generated/docs/ServiceAccountExternalOAuth.md @@ -0,0 +1,15 @@ + +# ServiceAccountExternalOAuth + + +## Properties + +Name | Type +------------ | ------------- +`integration` | [OAuthExternalIntegrationRef](OAuthExternalIntegrationRef.md) +`subject` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ServiceAccountListResponse.md b/src/rest/generated/docs/ServiceAccountListResponse.md new file mode 100644 index 0000000..bd7484b --- /dev/null +++ b/src/rest/generated/docs/ServiceAccountListResponse.md @@ -0,0 +1,15 @@ + +# ServiceAccountListResponse + + +## Properties + +Name | Type +------------ | ------------- +`serviceAccounts` | [Array<ServiceAccountResource>](ServiceAccountResource.md) +`meta` | [Meta](Meta.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ServiceAccountResource.md b/src/rest/generated/docs/ServiceAccountResource.md new file mode 100644 index 0000000..141ae36 --- /dev/null +++ b/src/rest/generated/docs/ServiceAccountResource.md @@ -0,0 +1,24 @@ + +# ServiceAccountResource + + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`label` | string +`description` | string +`createdBy` | [User](User.md) +`createdAt` | string +`updatedBy` | [User](User.md) +`updatedAt` | string +`disabled` | boolean +`apiTokenCount` | number +`rbacGroups` | [Array<RbacGroupRef>](RbacGroupRef.md) +`externalOAuth` | [ServiceAccountExternalOAuth](ServiceAccountExternalOAuth.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ServiceAccountUpdateRequest.md b/src/rest/generated/docs/ServiceAccountUpdateRequest.md new file mode 100644 index 0000000..70289eb --- /dev/null +++ b/src/rest/generated/docs/ServiceAccountUpdateRequest.md @@ -0,0 +1,17 @@ + +# ServiceAccountUpdateRequest + + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`description` | string +`disabled` | boolean +`externalOAuth` | [ServiceAccountExternalOAuth](ServiceAccountExternalOAuth.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/ServiceAccountsApi.md b/src/rest/generated/docs/ServiceAccountsApi.md new file mode 100644 index 0000000..0b6431a --- /dev/null +++ b/src/rest/generated/docs/ServiceAccountsApi.md @@ -0,0 +1,809 @@ +# ServiceAccountsApi + +All URIs are relative to *https://OBSERVE_CUSTOMERID.observeinc.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createApiToken**](ServiceAccountsApi.md#createapitoken) | **POST** /v1/service-accounts/{accountId}/api-tokens | Create an API token | +| [**createServiceAccount**](ServiceAccountsApi.md#createserviceaccount) | **POST** /v1/service-accounts | Create a service account | +| [**deleteApiToken**](ServiceAccountsApi.md#deleteapitoken) | **DELETE** /v1/service-accounts/{accountId}/api-tokens/{tokenId} | Delete an API token | +| [**deleteServiceAccount**](ServiceAccountsApi.md#deleteserviceaccount) | **DELETE** /v1/service-accounts/{accountId} | Delete a service account | +| [**getApiToken**](ServiceAccountsApi.md#getapitoken) | **GET** /v1/service-accounts/{accountId}/api-tokens/{tokenId} | Get an API token | +| [**getServiceAccount**](ServiceAccountsApi.md#getserviceaccount) | **GET** /v1/service-accounts/{accountId} | Get a service account | +| [**listApiTokens**](ServiceAccountsApi.md#listapitokens) | **GET** /v1/service-accounts/{accountId}/api-tokens | Get a list of API tokens for this service account | +| [**listServiceAccounts**](ServiceAccountsApi.md#listserviceaccounts) | **GET** /v1/service-accounts | Get a list of service accounts | +| [**updateApiToken**](ServiceAccountsApi.md#updateapitoken) | **PATCH** /v1/service-accounts/{accountId}/api-tokens/{tokenId} | Update an API token | +| [**updateServiceAccount**](ServiceAccountsApi.md#updateserviceaccount) | **PATCH** /v1/service-accounts/{accountId} | Update a service account | + + + +## createApiToken + +> ApiTokenResource createApiToken(accountId, apiTokenCreateRequest, expand) + +Create an API token + +### Example + +```ts +import { + Configuration, + ServiceAccountsApi, +} from ''; +import type { CreateApiTokenRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ServiceAccountsApi(config); + + const body = { + // string | The id of the service account associated with the API token + accountId: 1, + // ApiTokenCreateRequest + apiTokenCreateRequest: ..., + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + } satisfies CreateApiTokenRequest; + + try { + const data = await api.createApiToken(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | `string` | The id of the service account associated with the API token | [Defaults to `undefined`] | +| **apiTokenCreateRequest** | [ApiTokenCreateRequest](ApiTokenCreateRequest.md) | | | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ApiTokenResource**](ApiTokenResource.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | API token created successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createServiceAccount + +> ServiceAccountResource createServiceAccount(serviceAccountCreateRequest, expand) + +Create a service account + +### Example + +```ts +import { + Configuration, + ServiceAccountsApi, +} from ''; +import type { CreateServiceAccountRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ServiceAccountsApi(config); + + const body = { + // ServiceAccountCreateRequest + serviceAccountCreateRequest: ..., + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + } satisfies CreateServiceAccountRequest; + + try { + const data = await api.createServiceAccount(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **serviceAccountCreateRequest** | [ServiceAccountCreateRequest](ServiceAccountCreateRequest.md) | | | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ServiceAccountResource**](ServiceAccountResource.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Service account created successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteApiToken + +> deleteApiToken(accountId, tokenId) + +Delete an API token + +### Example + +```ts +import { + Configuration, + ServiceAccountsApi, +} from ''; +import type { DeleteApiTokenRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ServiceAccountsApi(config); + + const body = { + // string | The id of the service account associated with the API token + accountId: 1, + // string | The id of the API token to update + tokenId: 1, + } satisfies DeleteApiTokenRequest; + + try { + const data = await api.deleteApiToken(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | `string` | The id of the service account associated with the API token | [Defaults to `undefined`] | +| **tokenId** | `string` | The id of the API token to update | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | API token deleted successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteServiceAccount + +> deleteServiceAccount(accountId) + +Delete a service account + +### Example + +```ts +import { + Configuration, + ServiceAccountsApi, +} from ''; +import type { DeleteServiceAccountRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ServiceAccountsApi(config); + + const body = { + // string | The id of the service account to delete + accountId: 1, + } satisfies DeleteServiceAccountRequest; + + try { + const data = await api.deleteServiceAccount(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | `string` | The id of the service account to delete | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Service account deleted successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getApiToken + +> ApiTokenResource getApiToken(accountId, tokenId, expand) + +Get an API token + +Retrieve a specific API token by ID + +### Example + +```ts +import { + Configuration, + ServiceAccountsApi, +} from ''; +import type { GetApiTokenRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ServiceAccountsApi(config); + + const body = { + // string | The id of the service account associated with the API token + accountId: 1, + // string | The id of the API token to update + tokenId: 1, + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + } satisfies GetApiTokenRequest; + + try { + const data = await api.getApiToken(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | `string` | The id of the service account associated with the API token | [Defaults to `undefined`] | +| **tokenId** | `string` | The id of the API token to update | [Defaults to `undefined`] | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ApiTokenResource**](ApiTokenResource.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | API token queried successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getServiceAccount + +> ServiceAccountResource getServiceAccount(accountId, expand) + +Get a service account + +Retrieve a specific service account by ID + +### Example + +```ts +import { + Configuration, + ServiceAccountsApi, +} from ''; +import type { GetServiceAccountRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ServiceAccountsApi(config); + + const body = { + // string | The id of the service account + accountId: 1, + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + } satisfies GetServiceAccountRequest; + + try { + const data = await api.getServiceAccount(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | `string` | The id of the service account | [Defaults to `undefined`] | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ServiceAccountResource**](ServiceAccountResource.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Service account queried successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listApiTokens + +> ApiTokenListResponse listApiTokens(accountId, expand) + +Get a list of API tokens for this service account + +Get a list of all API tokens for this service account + +### Example + +```ts +import { + Configuration, + ServiceAccountsApi, +} from ''; +import type { ListApiTokensRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ServiceAccountsApi(config); + + const body = { + // string | The id of the service account associated with the API token + accountId: 1, + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + } satisfies ListApiTokensRequest; + + try { + const data = await api.listApiTokens(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | `string` | The id of the service account associated with the API token | [Defaults to `undefined`] | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ApiTokenListResponse**](ApiTokenListResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | API tokens queried successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listServiceAccounts + +> ServiceAccountListResponse listServiceAccounts(expand) + +Get a list of service accounts + +Get a list of all service accounts + +### Example + +```ts +import { + Configuration, + ServiceAccountsApi, +} from ''; +import type { ListServiceAccountsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ServiceAccountsApi(config); + + const body = { + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + } satisfies ListServiceAccountsRequest; + + try { + const data = await api.listServiceAccounts(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ServiceAccountListResponse**](ServiceAccountListResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Service account queried successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateApiToken + +> ApiTokenResource updateApiToken(accountId, tokenId, apiTokenUpdateRequest, expand) + +Update an API token + +### Example + +```ts +import { + Configuration, + ServiceAccountsApi, +} from ''; +import type { UpdateApiTokenRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ServiceAccountsApi(config); + + const body = { + // string | The id of the service account associated with the API token + accountId: 1, + // string | The id of the API token to update + tokenId: 1, + // ApiTokenUpdateRequest + apiTokenUpdateRequest: ..., + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + } satisfies UpdateApiTokenRequest; + + try { + const data = await api.updateApiToken(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | `string` | The id of the service account associated with the API token | [Defaults to `undefined`] | +| **tokenId** | `string` | The id of the API token to update | [Defaults to `undefined`] | +| **apiTokenUpdateRequest** | [ApiTokenUpdateRequest](ApiTokenUpdateRequest.md) | | | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ApiTokenResource**](ApiTokenResource.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | API token updated successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateServiceAccount + +> ServiceAccountResource updateServiceAccount(accountId, serviceAccountUpdateRequest, expand) + +Update a service account + +### Example + +```ts +import { + Configuration, + ServiceAccountsApi, +} from ''; +import type { UpdateServiceAccountRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new ServiceAccountsApi(config); + + const body = { + // string | The id of the service account to update + accountId: 1, + // ServiceAccountUpdateRequest + serviceAccountUpdateRequest: ..., + // boolean | Whether to expand resources referenced in the response to include additional fields (optional) + expand: true, + } satisfies UpdateServiceAccountRequest; + + try { + const data = await api.updateServiceAccount(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | `string` | The id of the service account to update | [Defaults to `undefined`] | +| **serviceAccountUpdateRequest** | [ServiceAccountUpdateRequest](ServiceAccountUpdateRequest.md) | | | +| **expand** | `boolean` | Whether to expand resources referenced in the response to include additional fields | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ServiceAccountResource**](ServiceAccountResource.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Service account updated successfully | - | +| **400** | Bad request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **429** | Rate limit reached | - | +| **5XX** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/src/rest/generated/docs/StagePresentationInput.md b/src/rest/generated/docs/StagePresentationInput.md new file mode 100644 index 0000000..8a1bdae --- /dev/null +++ b/src/rest/generated/docs/StagePresentationInput.md @@ -0,0 +1,17 @@ + +# StagePresentationInput + + +## Properties + +Name | Type +------------ | ------------- +`limit` | string +`linkify` | boolean +`wantBuckets` | string +`orderColumns` | [Array<StagePresentationInputOrderColumnsInner>](StagePresentationInputOrderColumnsInner.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/StagePresentationInputOrderColumnsInner.md b/src/rest/generated/docs/StagePresentationInputOrderColumnsInner.md new file mode 100644 index 0000000..fb2af48 --- /dev/null +++ b/src/rest/generated/docs/StagePresentationInputOrderColumnsInner.md @@ -0,0 +1,16 @@ + +# StagePresentationInputOrderColumnsInner + + +## Properties + +Name | Type +------------ | ------------- +`columnName` | string +`ascending` | boolean +`nullOrdering` | boolean + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/StageQuery.md b/src/rest/generated/docs/StageQuery.md new file mode 100644 index 0000000..b33b2e4 --- /dev/null +++ b/src/rest/generated/docs/StageQuery.md @@ -0,0 +1,16 @@ + +# StageQuery + + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`input` | [InputDefinition](InputDefinition.md) +`pipeline` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/StartDelegatedLogin200Response.md b/src/rest/generated/docs/StartDelegatedLogin200Response.md new file mode 100644 index 0000000..beb9a4d --- /dev/null +++ b/src/rest/generated/docs/StartDelegatedLogin200Response.md @@ -0,0 +1,15 @@ + +# StartDelegatedLogin200Response + + +## Properties + +Name | Type +------------ | ------------- +`url` | string +`serverToken` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/StartDelegatedLogin400Response.md b/src/rest/generated/docs/StartDelegatedLogin400Response.md new file mode 100644 index 0000000..cb0175b --- /dev/null +++ b/src/rest/generated/docs/StartDelegatedLogin400Response.md @@ -0,0 +1,15 @@ + +# StartDelegatedLogin400Response + + +## Properties + +Name | Type +------------ | ------------- +`ok` | boolean +`message` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/StartDelegatedLoginRequest.md b/src/rest/generated/docs/StartDelegatedLoginRequest.md new file mode 100644 index 0000000..77b01b2 --- /dev/null +++ b/src/rest/generated/docs/StartDelegatedLoginRequest.md @@ -0,0 +1,16 @@ + +# StartDelegatedLoginRequest + + +## Properties + +Name | Type +------------ | ------------- +`userEmail` | string +`clientToken` | string +`integration` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/StorageIntegrationBrief.md b/src/rest/generated/docs/StorageIntegrationBrief.md new file mode 100644 index 0000000..cca0896 --- /dev/null +++ b/src/rest/generated/docs/StorageIntegrationBrief.md @@ -0,0 +1,17 @@ + +# StorageIntegrationBrief + +Expanded fields for a storage integration reference. Present only when the parent resource is fetched with ?expand=true. + +## Properties + +Name | Type +------------ | ------------- +`label` | string +`type` | [StorageIntegrationType](StorageIntegrationType.md) +`storageProvider` | [StorageIntegrationStorageProvider](StorageIntegrationStorageProvider.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/StorageIntegrationRef.md b/src/rest/generated/docs/StorageIntegrationRef.md new file mode 100644 index 0000000..23dad37 --- /dev/null +++ b/src/rest/generated/docs/StorageIntegrationRef.md @@ -0,0 +1,16 @@ + +# StorageIntegrationRef + +A reference to a storage integration, used when embedded in other resources. Always includes id. When the parent resource is fetched with ?expand=true, the record object is present with label, type, and storageProvider. + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`record` | [StorageIntegrationBrief](StorageIntegrationBrief.md) + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/StorageIntegrationStorageProvider.md b/src/rest/generated/docs/StorageIntegrationStorageProvider.md new file mode 100644 index 0000000..77bd423 --- /dev/null +++ b/src/rest/generated/docs/StorageIntegrationStorageProvider.md @@ -0,0 +1,13 @@ + +# StorageIntegrationStorageProvider + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/StorageIntegrationType.md b/src/rest/generated/docs/StorageIntegrationType.md new file mode 100644 index 0000000..8f900b7 --- /dev/null +++ b/src/rest/generated/docs/StorageIntegrationType.md @@ -0,0 +1,13 @@ + +# StorageIntegrationType + + +## Properties + +Name | Type +------------ | ------------- + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/UpdateReferenceTable200Response.md b/src/rest/generated/docs/UpdateReferenceTable200Response.md new file mode 100644 index 0000000..76b92b2 --- /dev/null +++ b/src/rest/generated/docs/UpdateReferenceTable200Response.md @@ -0,0 +1,14 @@ + +# UpdateReferenceTable200Response + + +## Properties + +Name | Type +------------ | ------------- +`message` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/docs/User.md b/src/rest/generated/docs/User.md new file mode 100644 index 0000000..6d2698b --- /dev/null +++ b/src/rest/generated/docs/User.md @@ -0,0 +1,17 @@ + +# User + + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`label` | string +`timezone` | string +`locale` | string + + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/rest/generated/index.ts b/src/rest/generated/index.ts new file mode 100644 index 0000000..bebe8bb --- /dev/null +++ b/src/rest/generated/index.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './apis/index'; +export * from './models/index'; diff --git a/src/rest/generated/models/index.ts b/src/rest/generated/models/index.ts new file mode 100644 index 0000000..764cd44 --- /dev/null +++ b/src/rest/generated/models/index.ts @@ -0,0 +1,4999 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Statistics about notification actions taken for this alert + * @export + * @interface AlertActionStats + */ +export interface AlertActionStats { + /** + * + * @type {string} + * @memberof AlertActionStats + */ + numNotifsDiscarded: string; + /** + * + * @type {string} + * @memberof AlertActionStats + */ + numNotifsMuted: string; + /** + * When the alert was last muted. Null if never muted. + * @type {string} + * @memberof AlertActionStats + */ + lastMutedAt: string | null; + /** + * + * @type {string} + * @memberof AlertActionStats + */ + numNotifsSent: string; + /** + * When a notification was last sent. Null if never sent. + * @type {string} + * @memberof AlertActionStats + */ + lastSentAt: string | null; + /** + * + * @type {string} + * @memberof AlertActionStats + */ + numErrors: string; + /** + * When the last notification error occurred. Null if no errors. + * @type {string} + * @memberof AlertActionStats + */ + lastErroredAt: string | null; +} +/** + * A value captured at the time the alert was triggered + * @export + * @interface AlertCapturedValue + */ +export interface AlertCapturedValue { + /** + * + * @type {Array} + * @memberof AlertCapturedValue + */ + types: Array; + /** + * + * @type {AlertColumn} + * @memberof AlertCapturedValue + */ + column: AlertColumn; + /** + * The captured cell value. Null when the cell had no value. + * @type {string} + * @memberof AlertCapturedValue + */ + value: string | null; +} +/** + * + * @export + * @enum {string} + */ +export enum AlertCapturedValueType { + Aggregation = 'Aggregation', + GroupBy = 'GroupBy', + LinkSourceField = 'LinkSourceField' +} + +/** + * A column reference, either a direct column path, a link column, or a + * correlation tag. Exactly one of `linkColumn`, `columnPath`, or + * `correlationTag` is non-null. + * + * @export + * @interface AlertColumn + */ +export interface AlertColumn { + /** + * + * @type {AlertLinkColumn} + * @memberof AlertColumn + */ + linkColumn: AlertLinkColumn | null; + /** + * + * @type {AlertColumnPath} + * @memberof AlertColumn + */ + columnPath: AlertColumnPath | null; + /** + * + * @type {AlertCorrelationTag} + * @memberof AlertColumn + */ + correlationTag: AlertCorrelationTag | null; +} +/** + * + * @export + * @interface AlertColumnPath + */ +export interface AlertColumnPath { + /** + * The column's identifier within its dataset. This is the programmatic + * name used to look up the column, not a display label. + * + * @type {string} + * @memberof AlertColumnPath + */ + name: string; + /** + * Optional dotted path into a nested column. Null when absent. + * @type {string} + * @memberof AlertColumnPath + */ + path: string | null; +} +/** + * A context entry representing a grouping value for which the alert triggered + * @export + * @interface AlertContextEntry + */ +export interface AlertContextEntry { + /** + * + * @type {AlertColumn} + * @memberof AlertContextEntry + */ + column: AlertColumn; + /** + * + * @type {string} + * @memberof AlertContextEntry + */ + value: string; +} +/** + * A correlation tag reference. The tag identifier is the canonical + * name; the resolved backing column(s) are server-side details and + * not part of the wire shape. + * + * @export + * @interface AlertCorrelationTag + */ +export interface AlertCorrelationTag { + /** + * Canonical correlation tag identifier. + * @type {string} + * @memberof AlertCorrelationTag + */ + tag: string; +} +/** + * A single facet value and its alert count. + * @export + * @interface AlertFacetEntry + */ +export interface AlertFacetEntry { + /** + * The facet value used for filtering (e.g. "Active", "Critical", a + * monitor ID, or "true"/"false" for boolean facets). + * + * @type {string} + * @memberof AlertFacetEntry + */ + key: string; + /** + * Human-readable display label. For most facets this equals key. + * For monitors, this is the monitor label while key is the monitor ID. + * Null when no label is needed (i.e. it would equal key). + * + * @type {string} + * @memberof AlertFacetEntry + */ + label: string | null; + /** + * Number of alerts matching this facet value. + * @type {string} + * @memberof AlertFacetEntry + */ + count: string; +} +/** + * Faceted counts of all alerts in the requested time window, grouped by + * key attributes. Computed independently of any filter or pagination + * parameters. + * + * @export + * @interface AlertFacets + */ +export interface AlertFacets { + /** + * Count of alerts grouped by status (Active, Ended, Retracted). + * @type {Array} + * @memberof AlertFacets + */ + byStatus: Array; + /** + * Count of alerts grouped by severity level. + * @type {Array} + * @memberof AlertFacets + */ + byLevel: Array; + /** + * Count of alerts grouped by monitor, ordered by count descending. + * @type {Array} + * @memberof AlertFacets + */ + byMonitor: Array; + /** + * Count of alerts grouped by mute status. + * @type {Array} + * @memberof AlertFacets + */ + byMuted: Array; +} +/** + * Severity level of the alert + * @export + * @enum {string} + */ +export enum AlertLevel { + Critical = 'Critical', + Error = 'Error', + Warning = 'Warning', + Informational = 'Informational', + NoData = 'NoData', + None = 'None' +} + +/** + * + * @export + * @interface AlertLinkColumn + */ +export interface AlertLinkColumn { + /** + * The link column's identifier. This is the programmatic name used to + * look up the column, not a display label. + * + * @type {string} + * @memberof AlertLinkColumn + */ + name: string; + /** + * + * @type {AlertLinkColumnMeta} + * @memberof AlertLinkColumn + */ + meta: AlertLinkColumnMeta | null; +} +/** + * + * @export + * @interface AlertLinkColumnMeta + */ +export interface AlertLinkColumnMeta { + /** + * + * @type {Array} + * @memberof AlertLinkColumnMeta + */ + srcFields: Array | null; + /** + * + * @type {Array} + * @memberof AlertLinkColumnMeta + */ + dstFields: Array | null; + /** + * + * @type {ObjectRef} + * @memberof AlertLinkColumnMeta + */ + targetDataset: ObjectRef | null; +} +/** + * + * @export + * @interface AlertListResponse + */ +export interface AlertListResponse { + /** + * + * @type {Array} + * @memberof AlertListResponse + */ + alerts: Array; + /** + * + * @type {Meta} + * @memberof AlertListResponse + */ + meta: Meta; + /** + * Faceted counts for key alert attributes across all alerts in the time + * window. Independent of filter and pagination. Only included when + * includeFacets=true. + * + * @type {AlertFacets} + * @memberof AlertListResponse + */ + facets?: AlertFacets; +} +/** + * Fully-resolved service-binding triplet for an alert. Mirrors the + * GraphQL MonitorV2AlarmServiceBinding type. All three fields are + * non-empty when the object is populated; the field is omitted when + * no resolved triplet exists for the alert. + * + * @export + * @interface AlertResolvedServiceBinding + */ +export interface AlertResolvedServiceBinding { + /** + * Value of the `service.name` correlation tag. + * @type {string} + * @memberof AlertResolvedServiceBinding + */ + serviceName: string; + /** + * Value of the `deployment.environment.name` correlation tag. + * @type {string} + * @memberof AlertResolvedServiceBinding + */ + environment: string; + /** + * Value of the `service.namespace` correlation tag. + * @type {string} + * @memberof AlertResolvedServiceBinding + */ + serviceNamespace: string; +} +/** + * A monitor alert representing a detected condition. + * @export + * @interface AlertResource + */ +export interface AlertResource { + /** + * Unique identifier for the alert + * @type {string} + * @memberof AlertResource + */ + id: string; + /** + * When the alert condition first occurred + * @type {string} + * @memberof AlertResource + */ + start: string; + /** + * When the alert condition ended. Null for active alerts. + * @type {string} + * @memberof AlertResource + */ + end: string | null; + /** + * When the alert start was detected by the monitoring system. Null when not yet detected. + * @type {string} + * @memberof AlertResource + */ + detectedStart: string | null; + /** + * When the alert end was detected by the monitoring system. Null for active alerts. + * @type {string} + * @memberof AlertResource + */ + detectedEnd: string | null; + /** + * + * @type {AlertStatus} + * @memberof AlertResource + */ + status: AlertStatus; + /** + * + * @type {AlertLevel} + * @memberof AlertResource + */ + level: AlertLevel; + /** + * Hash of the grouping values for this alert + * @type {string} + * @memberof AlertResource + */ + groupingHash: string; + /** + * + * @type {Array} + * @memberof AlertResource + */ + capturedValues: Array; + /** + * + * @type {Array} + * @memberof AlertResource + */ + context: Array; + /** + * Version of the monitor when this alert was created + * @type {string} + * @memberof AlertResource + */ + monitorVersion: string; + /** + * Reference to the monitor that generated this alert. Always carries + * the id; the `record` field is populated only when expand=true. + * + * @type {MonitorRef} + * @memberof AlertResource + */ + monitor: MonitorRef; + /** + * Whether the alert is currently muted by active mute rules. + * @type {boolean} + * @memberof AlertResource + */ + muted: boolean; + /** + * + * @type {AlertResolvedServiceBinding} + * @memberof AlertResource + */ + resolvedServiceBinding?: AlertResolvedServiceBinding | null; + /** + * Action statistics for this alert. Only included when expand=true. + * @type {AlertActionStats} + * @memberof AlertResource + */ + stats?: AlertActionStats; +} + + +/** + * Current status of the alert + * @export + * @enum {string} + */ +export enum AlertStatus { + Active = 'Active', + Ended = 'Ended', + Retracted = 'Retracted' +} + +/** + * + * @export + * @interface ApiTokenCreateRequest + */ +export interface ApiTokenCreateRequest { + /** + * + * @type {string} + * @memberof ApiTokenCreateRequest + */ + label: string; + /** + * + * @type {string} + * @memberof ApiTokenCreateRequest + */ + description?: string; + /** + * + * @type {number} + * @memberof ApiTokenCreateRequest + */ + lifetimeHours: number; +} +/** + * + * @export + * @interface ApiTokenListResponse + */ +export interface ApiTokenListResponse { + /** + * + * @type {Array} + * @memberof ApiTokenListResponse + */ + apiTokens: Array; + /** + * + * @type {Meta} + * @memberof ApiTokenListResponse + */ + meta: Meta; +} +/** + * + * @export + * @interface ApiTokenResource + */ +export interface ApiTokenResource { + /** + * + * @type {string} + * @memberof ApiTokenResource + */ + id: string; + /** + * + * @type {string} + * @memberof ApiTokenResource + */ + label: string; + /** + * + * @type {string} + * @memberof ApiTokenResource + */ + description: string; + /** + * + * @type {string} + * @memberof ApiTokenResource + */ + expiration: string; + /** + * + * @type {User} + * @memberof ApiTokenResource + */ + createdBy: User; + /** + * + * @type {string} + * @memberof ApiTokenResource + */ + createdAt: string; + /** + * + * @type {User} + * @memberof ApiTokenResource + */ + updatedBy: User; + /** + * + * @type {string} + * @memberof ApiTokenResource + */ + updatedAt: string; + /** + * + * @type {boolean} + * @memberof ApiTokenResource + */ + disabled: boolean; + /** + * The secret for the API token. Only returned on create. + * @type {string} + * @memberof ApiTokenResource + */ + secret?: string; +} +/** + * + * @export + * @interface ApiTokenUpdateRequest + */ +export interface ApiTokenUpdateRequest { + /** + * + * @type {string} + * @memberof ApiTokenUpdateRequest + */ + label?: string; + /** + * + * @type {string} + * @memberof ApiTokenUpdateRequest + */ + description?: string; + /** + * + * @type {number} + * @memberof ApiTokenUpdateRequest + */ + lifetimeHours?: number; + /** + * + * @type {boolean} + * @memberof ApiTokenUpdateRequest + */ + disabled?: boolean; +} +/** + * + * @export + * @interface DatasetAccelerationError + */ +export interface DatasetAccelerationError { + /** + * + * @type {string} + * @memberof DatasetAccelerationError + */ + time: string; + /** + * + * @type {string} + * @memberof DatasetAccelerationError + */ + errorText: string; +} +/** + * + * @export + * @interface DatasetAccelerationInfo + */ +export interface DatasetAccelerationInfo { + /** + * + * @type {DatasetAccelerationState} + * @memberof DatasetAccelerationInfo + */ + state: DatasetAccelerationState; + /** + * Live staleness of the dataset. Null if alwaysAccelerated is true. + * @type {number} + * @memberof DatasetAccelerationInfo + */ + stalenessSeconds: number | null; + /** + * A stable, conservative measurement of what staleness the dataset is achieving + * over the past few hours. Null if alwaysAccelerated is true. + * + * @type {number} + * @memberof DatasetAccelerationInfo + */ + recentStalenessSeconds: number | null; + /** + * Reasons explaining why this dataset's freshness is what it is. + * Empty array indicates the dataset is meeting its freshness goal. + * Today the server returns at most one dominant reason; the list + * shape is reserved so we can return multiple stacked reasons + * (e.g. cost-throttle + decay together) in the future without an + * API contract change. + * + * @type {Array} + * @memberof DatasetAccelerationInfo + */ + stalenessReasons: Array; + /** + * User-configured staleness target of the dataset. Set to default value if not set by user. + * Actual target may be higher due to decaying or credit manager overrides. + * + * @type {number} + * @memberof DatasetAccelerationInfo + */ + userConfiguredTargetStalenessSeconds: number | null; + /** + * Target staleness of the dataset, ignoring downstream freshness goals. + * This can be higher than the configured staleness target due to decaying or credit manager overrides. + * + * @type {number} + * @memberof DatasetAccelerationInfo + */ + targetExcludingDownstreamStalenessSeconds: number | null; + /** + * Effective target staleness of the dataset. This is the value that the dataset is being kept up to date to. + * This can be higher or lower than the user-configured target staleness if the credit manager is active or downstream datasets staleness targets demand it. + * + * If `effectiveTargetStalenessSeconds > userConfiguredTargetStalenessSeconds`, then the credit manager is active on this dataset, and + * `effectiveTargetStalenessSeconds == rateLimitOverrideTargetStalenessSeconds`. + * If `effectiveTargetStalenessSeconds < userConfiguredTargetStalenessSeconds`, then a downstream dataset/monitor has a lower configured freshness goal. + * If `effectiveTargetStalenessSeconds == userConfiguredTargetStalenessSeconds`, then the configured freshness goal is in effect. + * + * @type {number} + * @memberof DatasetAccelerationInfo + */ + effectiveTargetStalenessSeconds: number | null; + /** + * The target staleness override for this dataset from the credit manager, if + * a transform credit rate limit is configured and is causing this dataset's + * configured freshness goal to be overridden. + * + * @type {number} + * @memberof DatasetAccelerationInfo + */ + rateLimitOverrideTargetStalenessSeconds: number | null; + /** + * + * @type {boolean} + * @memberof DatasetAccelerationInfo + */ + alwaysAccelerated: boolean; + /** + * + * @type {Array} + * @memberof DatasetAccelerationInfo + */ + acceleratedRanges: Array; + /** + * + * @type {Array} + * @memberof DatasetAccelerationInfo + */ + targetAcceleratedRanges: Array; + /** + * + * @type {string} + * @memberof DatasetAccelerationInfo + */ + freshnessTime: string | null; + /** + * + * @type {number} + * @memberof DatasetAccelerationInfo + */ + effectiveOnDemandMaterializationLengthDays: number; + /** + * + * @type {boolean} + * @memberof DatasetAccelerationInfo + */ + dataRetentionEnabled: boolean; + /** + * + * @type {number} + * @memberof DatasetAccelerationInfo + */ + effectiveDataRetentionPeriodDays: number | null; + /** + * + * @type {string} + * @memberof DatasetAccelerationInfo + */ + effectiveDataRetentionTimestamp: string | null; + /** + * + * @type {string} + * @memberof DatasetAccelerationInfo + */ + minimumDataTimestamp: string | null; + /** + * + * @type {string} + * @memberof DatasetAccelerationInfo + */ + hibernatedAt: string | null; + /** + * + * @type {Array} + * @memberof DatasetAccelerationInfo + */ + errors: Array; +} + + +/** + * The state of the dataset's acceleration. + * Initializing: The dataset is newly created/updated and acceleration has just started. + * Accelerated: The dataset is accelerated and available for querying. + * AcceleratedImmediately: The dataset is accelerated and available for querying. The dataset is also in "live mode", meaning it is being updated as fast as possible. + * Unavailable: The dataset is not accelerated and is not available for querying due to a compilation error in the dataset or upstream. + * Disabled: The dataset is not accelerated and is available for querying due to user disablement. (e.g. dataset is a view) + * Error: The dataset is not accelerated and may return outdated results due to a critical error. + * + * @export + * @enum {string} + */ +export enum DatasetAccelerationState { + Initializing = 'Initializing', + Accelerated = 'Accelerated', + AcceleratedImmediately = 'AcceleratedImmediately', + Unavailable = 'Unavailable', + Disabled = 'Disabled', + Error = 'Error' +} + +/** + * + * @export + * @enum {string} + */ +export enum DatasetAccelerationType { + InsertOnly = 'InsertOnly', + Aggregation = 'Aggregation', + Other = 'Other', + NotSupported = 'NotSupported' +} + +/** + * + * @export + * @interface DatasetAttributeStats + */ +export interface DatasetAttributeStats { + /** + * The attribute name that was queried + * @type {string} + * @memberof DatasetAttributeStats + */ + attribute: string; + /** + * Total distinct values for this attribute (including those not in top-K) + * @type {number} + * @memberof DatasetAttributeStats + */ + distinctCount: number; + /** + * Top-K value/count pairs, sorted by count descending + * @type {Array} + * @memberof DatasetAttributeStats + */ + stats: Array; +} +/** + * Brief record fields for a DatasetRef (label, description, iconUrl, contentType). Field naming mirrors ObjectBrief in this same file (iconUrl, not icon) for consistency across reference-brief pairs. + * + * @export + * @interface DatasetBrief + */ +export interface DatasetBrief { + /** + * + * @type {string} + * @memberof DatasetBrief + */ + label: string; + /** + * + * @type {string} + * @memberof DatasetBrief + */ + description: string; + /** + * + * @type {string} + * @memberof DatasetBrief + */ + iconUrl: string; + /** + * The type of data the referenced dataset contains — Resource, Log, + * Metric, OTelSpan, OTelTrace, or Unknown. Derived from the dataset's + * kind and interface bindings. + * + * @type {DatasetContentType} + * @memberof DatasetBrief + */ + contentType: DatasetContentType; +} + + +/** + * + * @export + * @interface DatasetCompilationError + */ +export interface DatasetCompilationError { + /** + * + * @type {string} + * @memberof DatasetCompilationError + */ + error: string; + /** + * + * @type {DatasetRef} + * @memberof DatasetCompilationError + */ + errorInDataset: DatasetRef | null; +} +/** + * The type of data a dataset contains. For Resource datasets, this is + * determined by the dataset kind. For other kinds, it is derived from the + * dataset's interface bindings. Returns Unknown if no recognized interface + * is found. + * + * @export + * @enum {string} + */ +export enum DatasetContentType { + Unknown = 'Unknown', + Resource = 'Resource', + Log = 'Log', + Metric = 'Metric', + OTelSpan = 'OTelSpan', + OTelTrace = 'OTelTrace' +} + +/** + * + * @export + * @interface DatasetCorrelationTag + */ +export interface DatasetCorrelationTag { + /** + * + * @type {string} + * @memberof DatasetCorrelationTag + */ + tag: string; + /** + * + * @type {DatasetFieldPath} + * @memberof DatasetCorrelationTag + */ + path: DatasetFieldPath; +} +/** + * + * @export + * @enum {string} + */ +export enum DatasetDataType { + None = 'None', + Bool = 'Bool', + Float64 = 'Float64', + Int64 = 'Int64', + String = 'String', + Timestamp = 'Timestamp', + Duration = 'Duration', + Ipv4 = 'IPv4', + TDigest = 'TDigest', + Array = 'Array', + Object = 'Object', + Variant = 'Variant', + Link = 'Link', + DatasetRef = 'DatasetRef' +} + +/** + * + * @export + * @enum {string} + */ +export enum DatasetDatasetKind { + Table = 'Table', + Resource = 'Resource', + Event = 'Event', + Interval = 'Interval' +} + +/** + * The kind of dataset definition. Values match `metatypes.TransformKind`'s + * string constants verbatim where the backend has one (`OPAL`, `Builtin`, + * `LogDerived`); `Source` and `Invalid` are REST-side additions for + * dataset shapes the backend does not surface as a TransformKind. + * - OPAL: dataset is produced by an OPAL transform pipeline. + * - Builtin: dataset is produced by a built-in transform (e.g. canonical-trace). + * - LogDerived: dataset is a log-derived metric. + * - Source: dataset receives data directly (datastream or external table); it has no transform. + * - Invalid: the stored transform kind is empty or unrecognised. Indicates corrupt or partially-migrated data, or a legacy SQL-kind transform (no production datasets carry one as of 2026-05-14). + * + * @export + * @enum {string} + */ +export enum DatasetDefinitionType { + Opal = 'OPAL', + Builtin = 'Builtin', + LogDerived = 'LogDerived', + Source = 'Source', + Invalid = 'Invalid' +} + +/** + * + * @export + * @interface DatasetFieldDesc + */ +export interface DatasetFieldDesc { + /** + * + * @type {string} + * @memberof DatasetFieldDesc + */ + name: string; + /** + * + * @type {DatasetFieldType} + * @memberof DatasetFieldDesc + */ + type: DatasetFieldType; + /** + * + * @type {Array} + * @memberof DatasetFieldDesc + */ + indexDefs: Array; + /** + * + * @type {DatasetForeignKey} + * @memberof DatasetFieldDesc + */ + linkDesc: DatasetForeignKey | null; + /** + * + * @type {boolean} + * @memberof DatasetFieldDesc + */ + isEnum: boolean; + /** + * + * @type {boolean} + * @memberof DatasetFieldDesc + */ + isSearchable: boolean; + /** + * + * @type {boolean} + * @memberof DatasetFieldDesc + */ + isHidden: boolean | null; + /** + * + * @type {boolean} + * @memberof DatasetFieldDesc + */ + isConst: boolean; + /** + * + * @type {boolean} + * @memberof DatasetFieldDesc + */ + isMetric: boolean; +} +/** + * + * @export + * @interface DatasetFieldPath + */ +export interface DatasetFieldPath { + /** + * + * @type {string} + * @memberof DatasetFieldPath + */ + field: string; + /** + * + * @type {string} + * @memberof DatasetFieldPath + */ + path: string; +} +/** + * + * @export + * @interface DatasetFieldType + */ +export interface DatasetFieldType { + /** + * + * @type {DatasetDataType} + * @memberof DatasetFieldType + */ + tag: DatasetDataType; +} + + +/** + * + * @export + * @interface DatasetForeignKey + */ +export interface DatasetForeignKey { + /** + * + * @type {string} + * @memberof DatasetForeignKey + */ + label: string; + /** + * + * @type {DatasetRef} + * @memberof DatasetForeignKey + */ + targetDataset: DatasetRef | null; + /** + * + * @type {string} + * @memberof DatasetForeignKey + */ + targetStageLabel: string | null; + /** + * + * @type {string} + * @memberof DatasetForeignKey + */ + targetLabelField: string | null; + /** + * + * @type {Array} + * @memberof DatasetForeignKey + */ + srcPaths: Array; + /** + * + * @type {Array} + * @memberof DatasetForeignKey + */ + dstFields: Array; +} +/** + * Response body for both GET /v1/datasets/graph and GET /v1/datasets/{id}/graph. + * On the full-graph endpoint: datasets are sorted by id ascending, and meta.totalCount + * is always the number of returned datasets (never -1). + * On the focal endpoint: datasets are sorted in BFS-nearest order (focal first, then + * by BFS depth, ties broken by id ascending for determinism), and meta.totalCount is + * -1 iff the BFS was capped by limit; otherwise it is the number of returned datasets. + * + * @export + * @interface DatasetGraphResponse + */ +export interface DatasetGraphResponse { + /** + * + * @type {Array} + * @memberof DatasetGraphResponse + */ + datasets: Array; + /** + * + * @type {Meta} + * @memberof DatasetGraphResponse + */ + meta: Meta; +} +/** + * Lean per-dataset projection used to render the Dataset Graph, Lineage tab, + * and Explore Universe views. Intentionally a strict subset of Dataset-Resource: + * only the fields required to render a graph node and its outgoing edges. + * expand is not supported on graph endpoints. + * + * NOTE: foreignKeyTargetIds and inputDatasetIds are returned as flat arrays of + * id strings rather than the nested reference shape used elsewhere in this API. + * This is a deliberate divergence from the REST Style Guide accepted for payload + * size on the full-graph endpoint; these fields are not expandable. + * + * @export + * @interface DatasetGraphSummary + */ +export interface DatasetGraphSummary { + /** + * + * @type {string} + * @memberof DatasetGraphSummary + */ + readonly id: string; + /** + * Full dataset label (path/name). + * @type {string} + * @memberof DatasetGraphSummary + */ + label: string; + /** + * + * @type {DatasetDatasetKind} + * @memberof DatasetGraphSummary + */ + kind: DatasetDatasetKind; + /** + * The content type (Resource, Log, Metric, OTelSpan, OTelTrace, Unknown). + * Combined with kind to pick the dataset icon in the UI. + * + * @type {DatasetContentType} + * @memberof DatasetGraphSummary + */ + contentType: DatasetContentType; + /** + * Explicit icon URL when set; null means the UI should derive from kind + contentType. + * @type {string} + * @memberof DatasetGraphSummary + */ + icon: string | null; + /** + * + * @type {DatasetCompilationError} + * @memberof DatasetGraphSummary + */ + compilationError: DatasetCompilationError | null; + /** + * The dataset's current acceleration state, projected out of AccelerationInfo. + * Exposed as a top-level scalar on this endpoint to avoid batch-loading the + * full AccelerationInfo object. + * + * @type {DatasetAccelerationState} + * @memberof DatasetGraphSummary + */ + accelerationState: DatasetAccelerationState; + /** + * Deduplicated list of foreign-key target dataset ids (forward edges only). + * Self-references and targets pointing at datasets excluded by the default filter + * are omitted. + * + * @type {Array} + * @memberof DatasetGraphSummary + */ + foreignKeyTargetIds: Array; + /** + * Deduplicated list of dataset ids that feed this dataset via transform inputs + * with InputRole=Data. Reference-role inputs are excluded. + * + * @type {Array} + * @memberof DatasetGraphSummary + */ + inputDatasetIds: Array; +} + + +/** + * + * @export + * @interface DatasetGroupingElement + */ +export interface DatasetGroupingElement { + /** + * + * @type {DatasetGroupingElementType} + * @memberof DatasetGroupingElement + */ + type: DatasetGroupingElementType; + /** + * + * @type {string} + * @memberof DatasetGroupingElement + */ + value: string; +} + + +/** + * + * @export + * @enum {string} + */ +export enum DatasetGroupingElementType { + Field = 'Field', + Link = 'Link' +} + +/** + * + * @export + * @interface DatasetGroupingKey + */ +export interface DatasetGroupingKey { + /** + * + * @type {Array} + * @memberof DatasetGroupingKey + */ + elements: Array; +} +/** + * + * @export + * @interface DatasetImplementedInterface + */ +export interface DatasetImplementedInterface { + /** + * + * @type {string} + * @memberof DatasetImplementedInterface + */ + path: string; + /** + * + * @type {Array} + * @memberof DatasetImplementedInterface + */ + mapping: Array; +} +/** + * + * @export + * @interface DatasetIndexDefinition + */ +export interface DatasetIndexDefinition { + /** + * + * @type {string} + * @memberof DatasetIndexDefinition + */ + field: string; + /** + * + * @type {DatasetIndexType} + * @memberof DatasetIndexDefinition + */ + type: DatasetIndexType; +} + + +/** + * + * @export + * @enum {string} + */ +export enum DatasetIndexType { + TokenIndex = 'TokenIndex', + SubstringIndex = 'SubstringIndex', + EqualityIndex = 'EqualityIndex', + AutoClusteringIndex = 'AutoClusteringIndex' +} + +/** + * + * @export + * @interface DatasetInterfaceFieldMapping + */ +export interface DatasetInterfaceFieldMapping { + /** + * + * @type {string} + * @memberof DatasetInterfaceFieldMapping + */ + interfaceField: string; + /** + * + * @type {string} + * @memberof DatasetInterfaceFieldMapping + */ + field: string; +} +/** + * + * @export + * @interface DatasetLegacyResource + */ +export interface DatasetLegacyResource { + /** + * + * @type {DatasetLegacyResourceMeta} + * @memberof DatasetLegacyResource + */ + meta: DatasetLegacyResourceMeta; + /** + * + * @type {DatasetLegacyResourceConfig} + * @memberof DatasetLegacyResource + */ + config: DatasetLegacyResourceConfig; + /** + * + * @type {DatasetLegacyResourceState} + * @memberof DatasetLegacyResource + */ + state: DatasetLegacyResourceState; +} +/** + * Directly settable properties of the dataset. + * @export + * @interface DatasetLegacyResourceConfig + */ +export interface DatasetLegacyResourceConfig { + /** + * + * @type {string} + * @memberof DatasetLegacyResourceConfig + */ + name: string; +} +/** + * Metadata about the dataset. + * @export + * @interface DatasetLegacyResourceMeta + */ +export interface DatasetLegacyResourceMeta { + /** + * + * @type {string} + * @memberof DatasetLegacyResourceMeta + */ + id: string; + /** + * + * @type {string} + * @memberof DatasetLegacyResourceMeta + */ + workspaceId: string; + /** + * + * @type {string} + * @memberof DatasetLegacyResourceMeta + */ + customerId: string; +} +/** + * Implicitly derived state of the dataset. + * @export + * @interface DatasetLegacyResourceState + */ +export interface DatasetLegacyResourceState { + /** + * + * @type {string} + * @memberof DatasetLegacyResourceState + */ + urlPath: string; + /** + * + * @type {string} + * @memberof DatasetLegacyResourceState + */ + kind: string; + /** + * + * @type {string} + * @memberof DatasetLegacyResourceState + */ + createdBy: string; + /** + * + * @type {string} + * @memberof DatasetLegacyResourceState + */ + createdDate: string; + /** + * + * @type {string} + * @memberof DatasetLegacyResourceState + */ + updatedBy: string; + /** + * + * @type {string} + * @memberof DatasetLegacyResourceState + */ + updatedDate: string; + /** + * + * @type {Array} + * @memberof DatasetLegacyResourceState + */ + columns?: Array; + /** + * + * @type {Array} + * @memberof DatasetLegacyResourceState + */ + interfaces?: Array; +} +/** + * + * @export + * @interface DatasetLegacyResourceStateColumnsInner + */ +export interface DatasetLegacyResourceStateColumnsInner { + /** + * + * @type {string} + * @memberof DatasetLegacyResourceStateColumnsInner + */ + name: string; + /** + * + * @type {string} + * @memberof DatasetLegacyResourceStateColumnsInner + */ + type: string; +} +/** + * + * @export + * @interface DatasetLegacyResourceStateInterfacesInner + */ +export interface DatasetLegacyResourceStateInterfacesInner { + /** + * + * @type {string} + * @memberof DatasetLegacyResourceStateInterfacesInner + */ + path?: string; + /** + * + * @type {Array} + * @memberof DatasetLegacyResourceStateInterfacesInner + */ + mapping?: Array; +} +/** + * + * @export + * @interface DatasetListResponse + */ +export interface DatasetListResponse { + /** + * + * @type {Array} + * @memberof DatasetListResponse + */ + datasets: Array; + /** + * + * @type {Meta} + * @memberof DatasetListResponse + */ + meta: Meta; +} +/** + * + * @export + * @interface DatasetQueryFilterCreateRequest + */ +export interface DatasetQueryFilterCreateRequest { + /** + * Human-readable name for the filter + * @type {string} + * @memberof DatasetQueryFilterCreateRequest + */ + label: string; + /** + * Long-form description of the filter + * @type {string} + * @memberof DatasetQueryFilterCreateRequest + */ + description?: string; + /** + * Legacy OPAL boolean expression string for the filter predicate (without the leading `filter` verb). + * + * Deprecated in favor of `pipeline` and may be removed in a future API version. Exactly one of `filter` or `pipeline` must be provided when creating a filter. + * + * @type {string} + * @memberof DatasetQueryFilterCreateRequest + */ + filter?: string; + /** + * Canonical OPAL pipeline snippet for the filter. May contain only filter verbs (and comments). + * + * Exactly one of `filter` or `pipeline` must be provided when creating a filter. `pipeline` is preferred for new integrations, as `filter` may be removed in a future API version. + * + * @type {string} + * @memberof DatasetQueryFilterCreateRequest + */ + pipeline?: string; + /** + * Whether the filter is disabled by the user + * @type {boolean} + * @memberof DatasetQueryFilterCreateRequest + */ + disabled?: boolean; + /** + * Activation window start time (inclusive). If omitted, the filter applies from negative infinity (unbounded from the past). + * @type {string} + * @memberof DatasetQueryFilterCreateRequest + */ + startTime?: string; + /** + * Activation window end time (exclusive). If omitted, the filter applies to positive infinity (unbounded to the future). + * @type {string} + * @memberof DatasetQueryFilterCreateRequest + */ + endTime?: string; + /** + * UI layout/metadata for the filter builder. This field is used by the Observe UI and should be omitted by other clients. + * @type {string} + * @memberof DatasetQueryFilterCreateRequest + */ + layout?: string; +} +/** + * + * @export + * @interface DatasetQueryFilterResource + */ +export interface DatasetQueryFilterResource { + /** + * + * @type {string} + * @memberof DatasetQueryFilterResource + */ + id: string; + /** + * Human-readable name for the filter + * @type {string} + * @memberof DatasetQueryFilterResource + */ + label: string; + /** + * Long-form description of the filter + * @type {string} + * @memberof DatasetQueryFilterResource + */ + description?: string; + /** + * Legacy OPAL boolean expression string for the filter predicate (without the leading `filter` verb). + * + * Deprecated in favor of `pipeline` and may be removed in a future API version. When creating or updating a filter, clients must provide exactly one of `filter` or `pipeline`. + * API responses always include both `filter` and `pipeline`; clients should consume `pipeline`. + * + * @type {string} + * @memberof DatasetQueryFilterResource + */ + filter: string; + /** + * Canonical OPAL pipeline snippet for the filter. May contain only filter verbs (and comments). + * + * When creating or updating a filter, clients must provide exactly one of `filter` or `pipeline`. + * API responses always include both `filter` and `pipeline`; clients should consume `pipeline`. + * + * @type {string} + * @memberof DatasetQueryFilterResource + */ + pipeline: string; + /** + * Whether the filter is disabled by the user + * @type {boolean} + * @memberof DatasetQueryFilterResource + */ + disabled: boolean; + /** + * List of error messages if the filter has issues (omitted if no errors) + * @type {Array} + * @memberof DatasetQueryFilterResource + */ + errors?: Array; + /** + * User who created the filter + * @type {User} + * @memberof DatasetQueryFilterResource + */ + createdBy: User; + /** + * When the filter was created + * @type {string} + * @memberof DatasetQueryFilterResource + */ + createdAt: string; + /** + * User who last updated the filter + * @type {User} + * @memberof DatasetQueryFilterResource + */ + updatedBy: User; + /** + * When the filter was last updated + * @type {string} + * @memberof DatasetQueryFilterResource + */ + updatedAt: string; + /** + * Activation window start time (inclusive). If omitted, the filter applies from negative infinity (unbounded from the past). + * @type {string} + * @memberof DatasetQueryFilterResource + */ + startTime?: string; + /** + * Activation window end time (exclusive). If omitted, the filter applies to positive infinity (unbounded to the future). + * @type {string} + * @memberof DatasetQueryFilterResource + */ + endTime?: string; + /** + * UI layout/metadata for the filter builder. This field is used by the Observe UI and should be omitted by other clients. + * @type {string} + * @memberof DatasetQueryFilterResource + */ + layout?: string; +} +/** + * + * @export + * @interface DatasetQueryFilterUpdateRequest + */ +export interface DatasetQueryFilterUpdateRequest { + /** + * Human-readable name for the filter + * @type {string} + * @memberof DatasetQueryFilterUpdateRequest + */ + label?: string; + /** + * Long-form description of the filter + * @type {string} + * @memberof DatasetQueryFilterUpdateRequest + */ + description?: string | null; + /** + * Legacy OPAL boolean expression string for the filter predicate (without the leading `filter` verb). + * + * Deprecated in favor of `pipeline` and may be removed in a future API version. When updating a filter's semantics, a request may provide either `filter` or `pipeline`, but not both. + * + * @type {string} + * @memberof DatasetQueryFilterUpdateRequest + */ + filter?: string; + /** + * Canonical OPAL pipeline snippet for the filter. May contain only filter verbs (and comments). + * + * When updating a filter's semantics, a request may provide either `filter` or `pipeline`, but not both. `pipeline` is preferred, as `filter` may be removed in a future API version. + * + * @type {string} + * @memberof DatasetQueryFilterUpdateRequest + */ + pipeline?: string; + /** + * Whether the filter is disabled by the user + * @type {boolean} + * @memberof DatasetQueryFilterUpdateRequest + */ + disabled?: boolean; + /** + * Activation window start time (inclusive). If omitted, the filter applies from negative infinity (unbounded from the past). + * @type {string} + * @memberof DatasetQueryFilterUpdateRequest + */ + startTime?: string | null; + /** + * Activation window end time (exclusive). If omitted, the filter applies to positive infinity (unbounded to the future). + * @type {string} + * @memberof DatasetQueryFilterUpdateRequest + */ + endTime?: string | null; + /** + * UI layout/metadata for the filter builder. This field is used by the Observe UI and should be omitted by other clients. + * @type {string} + * @memberof DatasetQueryFilterUpdateRequest + */ + layout?: string | null; +} +/** + * A reference to a dataset. Always carries the id; the optional `record` field carries the brief metadata, populated when expand=true. Mirrors ObjectRef (see ObjectRef / ObjectBrief in this file). + * + * @export + * @interface DatasetRef + */ +export interface DatasetRef { + /** + * + * @type {string} + * @memberof DatasetRef + */ + id: string; + /** + * + * @type {DatasetBrief} + * @memberof DatasetRef + */ + record?: DatasetBrief; +} +/** + * + * @export + * @interface DatasetRelatedKey + */ +export interface DatasetRelatedKey { + /** + * + * @type {string} + * @memberof DatasetRelatedKey + */ + label: string; + /** + * + * @type {DatasetRef} + * @memberof DatasetRelatedKey + */ + targetDataset: DatasetRef; + /** + * + * @type {Array} + * @memberof DatasetRelatedKey + */ + srcFields: Array; + /** + * + * @type {Array} + * @memberof DatasetRelatedKey + */ + dstFields: Array; +} +/** + * Observe Dataset with properties. + * @export + * @interface DatasetResource + */ +export interface DatasetResource { + /** + * + * @type {string} + * @memberof DatasetResource + */ + readonly id: string; + /** + * + * @type {string} + * @memberof DatasetResource + */ + label: string; + /** + * + * @type {string} + * @memberof DatasetResource + */ + description: string; + /** + * + * @type {string} + * @memberof DatasetResource + */ + icon: string; + /** + * + * @type {DatasetDatasetKind} + * @memberof DatasetResource + */ + kind: DatasetDatasetKind; + /** + * + * @type {string} + * @memberof DatasetResource + */ + source: string | null; + /** + * + * @type {string} + * @memberof DatasetResource + */ + lastUpdateSource: string | null; + /** + * + * @type {Array} + * @memberof DatasetResource + */ + fieldList: Array; + /** + * + * @type {string} + * @memberof DatasetResource + */ + validFromField: string | null; + /** + * + * @type {string} + * @memberof DatasetResource + */ + validToField: string | null; + /** + * + * @type {string} + * @memberof DatasetResource + */ + labelField: string | null; + /** + * + * @type {Array} + * @memberof DatasetResource + */ + primaryKey: Array; + /** + * + * @type {Array>} + * @memberof DatasetResource + */ + candidateKeys: Array>; + /** + * + * @type {Array} + * @memberof DatasetResource + */ + foreignKeys: Array; + /** + * + * @type {Array} + * @memberof DatasetResource + */ + relatedKeys: Array; + /** + * + * @type {DatasetGroupingKey} + * @memberof DatasetResource + */ + groupingKey: DatasetGroupingKey | null; + /** + * + * @type {Array} + * @memberof DatasetResource + */ + correlationTags: Array; + /** + * + * @type {boolean} + * @memberof DatasetResource + */ + isSource: boolean; + /** + * + * @type {Array} + * @memberof DatasetResource + */ + interfaces: Array; + /** + * The type of data this dataset contains. For Resource datasets, determined by + * the dataset kind. For other kinds, derived from the dataset's interface bindings. + * Returns Unknown if no recognized interface is found. + * + * @type {DatasetContentType} + * @memberof DatasetResource + */ + contentType: DatasetContentType; + /** + * Custom field mappings associated with the dataset's content type. Maps canonical + * field names to column name(s). Most fields map to a single column, but some + * (e.g. metric "tag") allow multiple columns. The exact set of keys depends on + * the contentType. For example, a Log dataset might have {"log": ["message"]}, while + * a Metric dataset might have {"metric": ["metric_name"], "value": ["metric_value"]}. + * Empty if the dataset has no recognized content type. + * + * @type {{ [key: string]: Array | undefined; }} + * @memberof DatasetResource + */ + customFieldMappings: { [key: string]: Array | undefined; }; + /** + * User-defined tags categorizing this dataset, as a map of tag key to a list + * of values. For example: {"env": ["prod", "staging"], "team": ["platform"]}. + * Empty if the dataset has no tags. + * + * @type {{ [key: string]: Array | undefined; }} + * @memberof DatasetResource + */ + objectTags: { [key: string]: Array | undefined; }; + /** + * + * @type {DatasetTimeAlignment} + * @memberof DatasetResource + */ + alignment: DatasetTimeAlignment | null; + /** + * + * @type {DatasetCompilationError} + * @memberof DatasetResource + */ + compilationError: DatasetCompilationError | null; + /** + * + * @type {ObjectRef} + * @memberof DatasetResource + */ + managedBy: ObjectRef | null; + /** + * + * @type {string} + * @memberof DatasetResource + */ + dataTableViewState: string | null; + /** + * + * @type {ObjectRef} + * @memberof DatasetResource + */ + defaultDashboard: ObjectRef | null; + /** + * + * @type {ObjectRef} + * @memberof DatasetResource + */ + defaultInstanceDashboard: ObjectRef | null; + /** + * + * @type {boolean} + * @memberof DatasetResource + */ + isView: boolean; + /** + * + * @type {boolean} + * @memberof DatasetResource + */ + isMonitor: boolean; + /** + * + * @type {boolean} + * @memberof DatasetResource + */ + isMetricSMA: boolean; + /** + * + * @type {DatasetAccelerationType} + * @memberof DatasetResource + */ + accelerationType: DatasetAccelerationType; + /** + * + * @type {DatasetAccelerationInfo} + * @memberof DatasetResource + */ + accelerationInfo: DatasetAccelerationInfo; + /** + * + * @type {User} + * @memberof DatasetResource + */ + createdBy: User; + /** + * + * @type {User} + * @memberof DatasetResource + */ + updatedBy: User; + /** + * + * @type {string} + * @memberof DatasetResource + */ + createdAt: string; + /** + * + * @type {string} + * @memberof DatasetResource + */ + updatedAt: string; + /** + * + * @type {StorageIntegrationRef} + * @memberof DatasetResource + */ + readonly storageIntegration: StorageIntegrationRef | null; + /** + * The kind of definition that produces this dataset. Always populated; + * classifies every dataset, including source datasets (datastreams / + * external tables) and rows whose stored kind is empty or corrupt. + * + * @type {DatasetDefinitionType} + * @memberof DatasetResource + */ + definitionType: DatasetDefinitionType; + /** + * Cosine similarity score (0–1). Only present when the `query` search + * parameter is used (semantic search). Omitted for non-semantic list + * requests. + * + * @type {number} + * @memberof DatasetResource + */ + readonly score?: number; +} + + +/** + * A reason explaining why a dataset's freshness is what it is. + * ConfiguredFreshnessGoal: The user-configured freshness goal is the dominant factor. + * CreditManagerOverride: A customer-level acceleration credit limit is forcing the freshness goal higher. + * SlowAcceleration: The dataset is being de-prioritized because it has not been queried recently (decay). + * ActiveBackfill: A backfill job is currently running for this dataset. + * DatasetHibernated: The dataset is hibernated. + * UnusedDatasetHibernating: The dataset is becoming hibernated due to lack of use. + * + * @export + * @enum {string} + */ +export enum DatasetStalenessReason { + ConfiguredFreshnessGoal = 'ConfiguredFreshnessGoal', + CreditManagerOverride = 'CreditManagerOverride', + SlowAcceleration = 'SlowAcceleration', + ActiveBackfill = 'ActiveBackfill', + DatasetHibernated = 'DatasetHibernated', + UnusedDatasetHibernating = 'UnusedDatasetHibernating' +} + +/** + * + * @export + * @interface DatasetStatValueCount + */ +export interface DatasetStatValueCount { + /** + * The attribute value, always serialized as a JSON string regardless + * of the attribute's CEL type. Strings appear verbatim; ints as + * decimal digits (e.g. `"41000234"`); bools as `"true"` or + * `"false"`; timestamps as RFC 3339 strings (e.g. + * `"2024-01-01T00:00:00Z"`). + * + * @type {string} + * @memberof DatasetStatValueCount + */ + value: string; + /** + * Number of datasets with this value + * @type {number} + * @memberof DatasetStatValueCount + */ + count: number; +} +/** + * + * @export + * @interface DatasetStatsMeta + */ +export interface DatasetStatsMeta { + /** + * Total number of datasets before applying filter + * @type {number} + * @memberof DatasetStatsMeta + */ + totalDatasets: number; + /** + * Number of datasets after applying filter (equal to totalDatasets when no filter) + * @type {number} + * @memberof DatasetStatsMeta + */ + filteredDatasets: number; +} +/** + * Aggregated stats for requested dataset attributes + * @export + * @interface DatasetStatsResponse + */ +export interface DatasetStatsResponse { + /** + * One entry per requested `attributes` expression, in request + * order. Empty array if `attributes` was empty in the request. + * + * @type {Array} + * @memberof DatasetStatsResponse + */ + attributes: Array; + /** + * One entry per requested `multiValueAttributes` expression, in + * request order. Empty array if `multiValueAttributes` was empty in + * the request. Each entry's `count` values are total + * occurrences across all matching datasets and may exceed + * `meta.filteredDatasets`. + * + * @type {Array} + * @memberof DatasetStatsResponse + */ + multiValueAttributes: Array; + /** + * + * @type {DatasetStatsMeta} + * @memberof DatasetStatsResponse + */ + meta: DatasetStatsMeta; +} +/** + * + * @export + * @interface DatasetTimeAlignment + */ +export interface DatasetTimeAlignment { + /** + * + * @type {string} + * @memberof DatasetTimeAlignment + */ + stepSizeNanoseconds: string; + /** + * + * @type {string} + * @memberof DatasetTimeAlignment + */ + offsetNanoseconds: string; +} +/** + * + * @export + * @interface DocumentationSearchRequest + */ +export interface DocumentationSearchRequest { + /** + * Natural-language search query. + * @type {string} + * @memberof DocumentationSearchRequest + */ + query: string; + /** + * Maximum number of results to return. + * @type {number} + * @memberof DocumentationSearchRequest + */ + limit?: number; + /** + * Minimum cosine similarity score. Results below this threshold are excluded. + * @type {number} + * @memberof DocumentationSearchRequest + */ + minScore?: number; +} +/** + * + * @export + * @interface DocumentationSearchResponse + */ +export interface DocumentationSearchResponse { + /** + * + * @type {Array} + * @memberof DocumentationSearchResponse + */ + documentation: Array; + /** + * + * @type {Meta} + * @memberof DocumentationSearchResponse + */ + meta: Meta; +} +/** + * + * @export + * @interface DocumentationSearchResult + */ +export interface DocumentationSearchResult { + /** + * Chunk title, typically the source document or section name. + * @type {string} + * @memberof DocumentationSearchResult + */ + title: string; + /** + * The chunk's text content. + * @type {string} + * @memberof DocumentationSearchResult + */ + text: string; + /** + * Link to the full documentation page on docs.observeinc.com, or null if unavailable. + * @type {string} + * @memberof DocumentationSearchResult + */ + url?: string | null; +} +/** + * + * @export + * @interface ErrorMessage + */ +export interface ErrorMessage { + /** + * A stable, machine-readable identifier for the kind of error. + * @type {string} + * @memberof ErrorMessage + */ + type: string; + /** + * Error message + * @type {string} + * @memberof ErrorMessage + */ + message: string; +} +/** + * + * @export + * @interface ExportQueryRequest + */ +export interface ExportQueryRequest { + /** + * + * @type {ExportQueryRequestQuery} + * @memberof ExportQueryRequest + */ + query: ExportQueryRequestQuery; + /** + * The maximum number of rows to return. Defaults to 100,000, which is the maximum if paginate=false. If paginate=true rowCount can be up to the maximum value of int64 (9,223,372,036,854,775,807). + * @type {string} + * @memberof ExportQueryRequest + */ + rowCount?: string; + /** + * + * @type {StagePresentationInput} + * @memberof ExportQueryRequest + */ + presentation?: StagePresentationInput; +} +/** + * Encodes the actual OPAL query and its inputs. + * @export + * @interface ExportQueryRequestQuery + */ +export interface ExportQueryRequestQuery { + /** + * The name of the stage that will be used as output. Defaults to the last specified stage. + * @type {string} + * @memberof ExportQueryRequestQuery + */ + outputStage?: string; + /** + * Describes one or more stage pipelines to execute. Stages can reference each other, but not in a cyclic fashion. + * @type {Array} + * @memberof ExportQueryRequestQuery + */ + stages: Array; + /** + * Parameters defined for $variables (used for default values) + * @type {Array} + * @memberof ExportQueryRequestQuery + */ + parameters?: Array; + /** + * Parameter values bound for $variables for this execution. + * @type {Array} + * @memberof ExportQueryRequestQuery + */ + parameterValues?: Array; +} +/** + * + * @export + * @interface ExportQueryRequestQueryStagesInner + */ +export interface ExportQueryRequestQueryStagesInner { + /** + * Describes the @name bindings for input datasets or stages. The first input is provided as the default input to the pipeline. + * @type {Array} + * @memberof ExportQueryRequestQueryStagesInner + */ + input: Array; + /** + * The ID to assign to this stage when binding as input to other datasets. + * @type {string} + * @memberof ExportQueryRequestQueryStagesInner + */ + stageID: string; + /** + * The actual OPAL pipeline to execute. You can use embedded newlines, + * or the pipe | character to separate verb clauses. You can include + * embedded sub-queries, too. + * + * @type {string} + * @memberof ExportQueryRequestQueryStagesInner + */ + pipeline: string; + /** + * Parameters defined for $variables (used for default values) + * @type {Array} + * @memberof ExportQueryRequestQueryStagesInner + */ + parameters?: Array; + /** + * Parameter values bound for $variables for this execution. + * @type {Array} + * @memberof ExportQueryRequestQueryStagesInner + */ + parameterValues?: Array; +} +/** + * + * @export + * @interface GenerateAPITokenRequest + */ +export interface GenerateAPITokenRequest { + /** + * The email address of the user to mint credentials for. + * @type {string} + * @memberof GenerateAPITokenRequest + */ + userEmail: string; + /** + * The password of the user minting credentials. + * @type {string} + * @memberof GenerateAPITokenRequest + */ + userPassword: string; + /** + * Optional name of the token, to remember what it is for. + * @type {string} + * @memberof GenerateAPITokenRequest + */ + tokenName?: string; +} +/** + * + * @export + * @interface GetDatasetById200Response + */ +export interface GetDatasetById200Response { + /** + * + * @type {boolean} + * @memberof GetDatasetById200Response + */ + ok?: boolean; + /** + * + * @type {DatasetLegacyResource} + * @memberof GetDatasetById200Response + */ + data?: DatasetLegacyResource; +} +/** + * + * @export + * @interface InputDefinition + */ +export interface InputDefinition { + /** + * The @name used to reference this input in OPAL (without the @ sign) + * @type {string} + * @memberof InputDefinition + */ + inputName: string; + /** + * Data or Reference, defaults to Data if not specified. + * @type {string} + * @memberof InputDefinition + */ + inputRole?: string; + /** + * The dataset ID (as int64-string) to bind to this name. + * @type {string} + * @memberof InputDefinition + */ + datasetId?: string; + /** + * The dataset name as Workspace.path/Name to bind to this name, if not using datasetId. + * @type {string} + * @memberof InputDefinition + */ + datasetPath?: string; + /** + * The stageID of the previously defined stage to reference, if it's a stage and not a dataset. + * @type {string} + * @memberof InputDefinition + */ + stageId?: string; + /** + * The parameter ID to take the input dataset reference from. (Advanced usage only) + * @type {string} + * @memberof InputDefinition + */ + parameterId?: string; +} +/** + * + * @export + * @interface ListDatasetQueryFilters200Response + */ +export interface ListDatasetQueryFilters200Response { + /** + * + * @type {Array} + * @memberof ListDatasetQueryFilters200Response + */ + queryFilters: Array; + /** + * + * @type {Meta} + * @memberof ListDatasetQueryFilters200Response + */ + meta: Meta; +} +/** + * + * @export + * @interface ListDatasetsResponse + */ +export interface ListDatasetsResponse { + /** + * + * @type {boolean} + * @memberof ListDatasetsResponse + */ + ok?: boolean; + /** + * + * @type {Array} + * @memberof ListDatasetsResponse + */ + data?: Array; +} +/** + * List Response Metadata + * @export + * @interface Meta + */ +export interface Meta { + /** + * The total number of resources available, independent of pagination. + * The API may return -1 if the total count is unknown or cannot be computed + * in reasonable time. + * + * @type {number} + * @memberof Meta + */ + totalCount: number; +} +/** + * Brief monitor metadata included when a reference is expanded. + * @export + * @interface MonitorBrief + */ +export interface MonitorBrief { + /** + * The monitor's display label. + * @type {string} + * @memberof MonitorBrief + */ + label: string; + /** + * The monitor's description. Null when no description is configured. + * @type {string} + * @memberof MonitorBrief + */ + description: string | null; +} +/** + * + * @export + * @interface MonitorMuteCreateRequest + */ +export interface MonitorMuteCreateRequest { + /** + * + * @type {string} + * @memberof MonitorMuteCreateRequest + */ + label: string; + /** + * Free-form description. Omit to leave blank. + * @type {string} + * @memberof MonitorMuteCreateRequest + */ + description?: string; + /** + * + * @type {MonitorMuteTargetInput} + * @memberof MonitorMuteCreateRequest + */ + target: MonitorMuteTargetInput; + /** + * + * @type {MonitorMuteScheduleInput} + * @memberof MonitorMuteCreateRequest + */ + schedule: MonitorMuteScheduleInput; + /** + * CEL boolean expression evaluated against each fired alarm row. Required and non-empty when `target.kind` is `Global` (prevents accidental fleet-wide suppression). When `target.kind` is `Monitors`, omit to suppress all firings for those monitors unconditionally. Example: `level == "Critical" && context["service"] == "payments"`. + * + * @type {string} + * @memberof MonitorMuteCreateRequest + */ + filter?: string; +} +/** + * + * @export + * @interface MonitorMuteCronSchedule + */ +export interface MonitorMuteCronSchedule { + /** + * POSIX 5-field cron expression (`minute hour day-of-month month day-of-week`). No seconds field, no year field, no Quartz extensions, no `@daily`-style macros. Fields support `*` (any), `,` (list), `-` (range), and `/` (step). The server rejects expressions outside this dialect with `invalid_schedule`. Examples: `0 2 * * *` (daily at 02:00), `0 9-17 * * 1-5` (every hour 09:00–17:00 Mon–Fri), `0-59/15 * * * *` (every 15 min). + * + * @type {string} + * @memberof MonitorMuteCronSchedule + */ + rawCron: string; + /** + * IANA timezone name. Example: "America/Los_Angeles". + * @type {string} + * @memberof MonitorMuteCronSchedule + */ + timezone: string; +} +/** + * + * @export + * @interface MonitorMuteListResponse + */ +export interface MonitorMuteListResponse { + /** + * + * @type {Array} + * @memberof MonitorMuteListResponse + */ + monitorMutes: Array; + /** + * + * @type {Meta} + * @memberof MonitorMuteListResponse + */ + meta: Meta; +} +/** + * A one-time mute window. Always fully populated in responses. + * @export + * @interface MonitorMuteOneTime + */ +export interface MonitorMuteOneTime { + /** + * Start of the mute window. + * @type {string} + * @memberof MonitorMuteOneTime + */ + startTime: string; + /** + * End of the mute window. `null` means until manually deleted. + * @type {string} + * @memberof MonitorMuteOneTime + */ + endTime: string | null; +} +/** + * Input shape for a one-time schedule. `startTime` is required. Omit `endTime` or pass `null` to create an open-ended mute. + * + * @export + * @interface MonitorMuteOneTimeInput + */ +export interface MonitorMuteOneTimeInput { + /** + * Start of the mute window. + * @type {string} + * @memberof MonitorMuteOneTimeInput + */ + startTime: string; + /** + * End of the mute window. Omit or pass `null` for open-ended. + * @type {string} + * @memberof MonitorMuteOneTimeInput + */ + endTime?: string | null; +} +/** + * A recurring mute window driven by a cron schedule. + * @export + * @interface MonitorMuteRecurring + */ +export interface MonitorMuteRecurring { + /** + * + * @type {MonitorMuteCronSchedule} + * @memberof MonitorMuteRecurring + */ + cronSchedule: MonitorMuteCronSchedule; + /** + * Wall-clock length of each fired window in seconds. Must be at least 1. + * @type {number} + * @memberof MonitorMuteRecurring + */ + durationSeconds: number; +} +/** + * Input shape for a recurring schedule. Mirrors `MonitorMute-Recurring`; kept separate so server-computed response fields can be added to the response type without widening the write contract. + * + * @export + * @interface MonitorMuteRecurringInput + */ +export interface MonitorMuteRecurringInput { + /** + * + * @type {MonitorMuteCronSchedule} + * @memberof MonitorMuteRecurringInput + */ + cronSchedule: MonitorMuteCronSchedule; + /** + * Wall-clock length of each fired window in seconds. Must be at least 1. + * @type {number} + * @memberof MonitorMuteRecurringInput + */ + durationSeconds: number; +} +/** + * A mute rule suppresses alert notifications during a defined time window. Use `target.kind: Global` to mute all monitors, or `target.kind: Monitors` to target a specific set. + * + * @export + * @interface MonitorMuteResource + */ +export interface MonitorMuteResource { + /** + * + * @type {string} + * @memberof MonitorMuteResource + */ + id: string; + /** + * Human-readable name for this mute rule. + * @type {string} + * @memberof MonitorMuteResource + */ + label: string; + /** + * Free-form description. `null` when unset. + * @type {string} + * @memberof MonitorMuteResource + */ + description: string | null; + /** + * + * @type {MonitorMuteTarget} + * @memberof MonitorMuteResource + */ + target: MonitorMuteTarget; + /** + * + * @type {MonitorMuteSchedule} + * @memberof MonitorMuteResource + */ + schedule: MonitorMuteSchedule; + /** + * Optional CEL boolean expression evaluated against each fired alarm row at notification time. `null` means every firing is suppressed. Required and non-empty when `target.kind` is `Global` to prevent accidental fleet-wide suppression. Example: `level == "Critical" && context["service"] == "payments"`. + * + * @type {string} + * @memberof MonitorMuteResource + */ + filter: string | null; + /** + * Computed start of the current or next active window. For `OneTime` schedules this mirrors `schedule.oneTime.startTime`. For `Recurring` schedules this is the next computed firing time. `null` between recurring windows. + * + * @type {string} + * @memberof MonitorMuteResource + */ + startTime: string | null; + /** + * Computed end of the current or next active window. For `OneTime` schedules this mirrors `schedule.oneTime.endTime` (`null` for open-ended mutes). For `Recurring` schedules this is `startTime + durationSeconds`. + * + * @type {string} + * @memberof MonitorMuteResource + */ + endTime: string | null; + /** + * + * @type {User} + * @memberof MonitorMuteResource + */ + createdBy: User; + /** + * + * @type {string} + * @memberof MonitorMuteResource + */ + createdAt: string; + /** + * + * @type {User} + * @memberof MonitorMuteResource + */ + updatedBy: User; + /** + * + * @type {string} + * @memberof MonitorMuteResource + */ + updatedAt: string; +} +/** + * Discriminated schedule. Both `oneTime` and `recurring` are always present in responses; the inactive sibling is `null`. + * + * @export + * @interface MonitorMuteSchedule + */ +export interface MonitorMuteSchedule { + /** + * + * @type {MonitorMuteScheduleKind} + * @memberof MonitorMuteSchedule + */ + kind: MonitorMuteScheduleKind; + /** + * + * @type {MonitorMuteOneTime} + * @memberof MonitorMuteSchedule + */ + oneTime: MonitorMuteOneTime | null; + /** + * + * @type {MonitorMuteRecurring} + * @memberof MonitorMuteSchedule + */ + recurring: MonitorMuteRecurring | null; +} + + +/** + * Input shape for a schedule. `kind` is required; send only the sibling matching `kind` (`oneTime` or `recurring`). + * + * @export + * @interface MonitorMuteScheduleInput + */ +export interface MonitorMuteScheduleInput { + /** + * + * @type {MonitorMuteScheduleKind} + * @memberof MonitorMuteScheduleInput + */ + kind: MonitorMuteScheduleKind; + /** + * + * @type {MonitorMuteOneTimeInput} + * @memberof MonitorMuteScheduleInput + */ + oneTime?: MonitorMuteOneTimeInput; + /** + * + * @type {MonitorMuteRecurringInput} + * @memberof MonitorMuteScheduleInput + */ + recurring?: MonitorMuteRecurringInput; +} + + +/** + * `OneTime` defines a fixed window with an explicit start and optional end. `Recurring` fires on a cron schedule for a specified duration. + * + * @export + * @enum {string} + */ +export enum MonitorMuteScheduleKind { + OneTime = 'OneTime', + Recurring = 'Recurring' +} + +/** + * Describes which monitors this mute rule applies to. `monitors` is always present: empty when `kind` is `Global`, non-empty when `kind` is `Monitors`. + * + * @export + * @interface MonitorMuteTarget + */ +export interface MonitorMuteTarget { + /** + * + * @type {MonitorMuteTargetKind} + * @memberof MonitorMuteTarget + */ + kind: MonitorMuteTargetKind; + /** + * + * @type {Array} + * @memberof MonitorMuteTarget + */ + monitors: Array; +} + + +/** + * Input shape for a mute target. `kind` is optional in PATCH — if provided it must match the existing value since `kind` is immutable after creation. `monitors` is required and non-empty when `kind` is `Monitors`; omit or leave empty when `kind` is `Global`. + * + * @export + * @interface MonitorMuteTargetInput + */ +export interface MonitorMuteTargetInput { + /** + * + * @type {MonitorMuteTargetKind} + * @memberof MonitorMuteTargetInput + */ + kind?: MonitorMuteTargetKind; + /** + * + * @type {Array} + * @memberof MonitorMuteTargetInput + */ + monitors?: Array; +} + + +/** + * `Global` suppresses all monitors (requires a non-empty `filter`). `Monitors` targets a specific set of monitors by ID. + * + * @export + * @enum {string} + */ +export enum MonitorMuteTargetKind { + Global = 'Global', + Monitors = 'Monitors' +} + +/** + * All fields are optional. Omitted fields are left unchanged. Sending a `target` object replaces the entire target subtree atomically; `target.kind` must match the existing value (it is immutable). Send `filter: null` to remove an existing filter. + * + * @export + * @interface MonitorMuteUpdateRequest + */ +export interface MonitorMuteUpdateRequest { + /** + * + * @type {string} + * @memberof MonitorMuteUpdateRequest + */ + label?: string; + /** + * Pass `null` to clear the description. + * @type {string} + * @memberof MonitorMuteUpdateRequest + */ + description?: string | null; + /** + * + * @type {MonitorMuteTargetInput} + * @memberof MonitorMuteUpdateRequest + */ + target?: MonitorMuteTargetInput; + /** + * + * @type {MonitorMuteScheduleInput} + * @memberof MonitorMuteUpdateRequest + */ + schedule?: MonitorMuteScheduleInput; + /** + * Pass `null` to remove an existing filter. + * @type {string} + * @memberof MonitorMuteUpdateRequest + */ + filter?: string | null; +} +/** + * Reference to a monitor. Always carries the `id`. The `record` field is + * populated with brief metadata only when `expand=true`. + * + * @export + * @interface MonitorRef + */ +export interface MonitorRef { + /** + * + * @type {string} + * @memberof MonitorRef + */ + id: string; + /** + * + * @type {MonitorBrief} + * @memberof MonitorRef + */ + record?: MonitorBrief; +} +/** + * + * @export + * @interface MonitorV2 + */ +export interface MonitorV2 { + /** + * + * @type {string} + * @memberof MonitorV2 + */ + readonly id: string; + /** + * + * @type {string} + * @memberof MonitorV2 + */ + name: string; + /** + * + * @type {boolean} + * @memberof MonitorV2 + */ + readonly disabled?: boolean; + /** + * + * @type {MonitorV2RuleKind} + * @memberof MonitorV2 + */ + ruleKind: MonitorV2RuleKind; + /** + * + * @type {MonitorV2Definition} + * @memberof MonitorV2 + */ + definition: MonitorV2Definition; + /** + * + * @type {Array} + * @memberof MonitorV2 + */ + actionRules?: Array; + /** + * The resolved scheduling mode the monitor is actually using, as determined by the backend. Always populated on GET responses. This may differ from definition.scheduling, which only reflects what the user explicitly configured. Ignored on POST/PATCH. + * + * @type {MonitorV2Scheduling} + * @memberof MonitorV2 + */ + readonly effectiveScheduling?: MonitorV2Scheduling; +} + + +/** + * + * @export + * @interface MonitorV2ActionDefinition + */ +export interface MonitorV2ActionDefinition { + /** + * + * @type {boolean} + * @memberof MonitorV2ActionDefinition + */ + inline?: boolean; + /** + * + * @type {MonitorV2ActionType} + * @memberof MonitorV2ActionDefinition + */ + type?: MonitorV2ActionType; + /** + * + * @type {MonitorV2EmailAction} + * @memberof MonitorV2ActionDefinition + */ + email?: MonitorV2EmailAction; + /** + * + * @type {MonitorV2WebhookAction} + * @memberof MonitorV2ActionDefinition + */ + webhook?: MonitorV2WebhookAction; +} + + +/** + * Either the actionId or the definition must be present when setting. + * The actionId references an existing shared action, while the + * definition would be used to configure an inline (private to a monitor) + * action. + * + * @export + * @interface MonitorV2ActionRule + */ +export interface MonitorV2ActionRule { + /** + * + * @type {string} + * @memberof MonitorV2ActionRule + */ + actionId?: string; + /** + * + * @type {MonitorV2AlarmLevel} + * @memberof MonitorV2ActionRule + */ + levels?: MonitorV2AlarmLevel; + /** + * + * @type {MonitorV2ComparisonExpression} + * @memberof MonitorV2ActionRule + */ + conditions?: MonitorV2ComparisonExpression; + /** + * + * @type {boolean} + * @memberof MonitorV2ActionRule + */ + sendEndNotifications?: boolean; + /** + * + * @type {boolean} + * @memberof MonitorV2ActionRule + */ + sendRemindersInterval?: boolean; + /** + * + * @type {MonitorV2ActionDefinition} + * @memberof MonitorV2ActionRule + */ + definition?: MonitorV2ActionDefinition; +} + + +/** + * + * @export + * @enum {string} + */ +export enum MonitorV2ActionType { + Email = 'Email', + PagerDuty = 'PagerDuty', + Slack = 'Slack', + Webhook = 'Webhook' +} + +/** + * + * @export + * @enum {string} + */ +export enum MonitorV2AlarmLevel { + Critical = 'Critical', + Error = 'Error', + Informational = 'Informational', + None = 'None', + Warning = 'Warning' +} + +/** + * + * @export + * @enum {string} + */ +export enum MonitorV2BooleanOperator { + And = 'And', + Or = 'Or' +} + +/** + * Identifies a column in a monitor's input pipeline. At most one of + * `linkColumn`, `columnPath`, and `correlationTag` may be set; the + * save-time validator rejects violations of this one-of contract. + * + * @export + * @interface MonitorV2Column + */ +export interface MonitorV2Column { + /** + * + * @type {MonitorV2LinkColumn} + * @memberof MonitorV2Column + */ + linkColumn?: MonitorV2LinkColumn; + /** + * + * @type {MonitorV2ColumnPath} + * @memberof MonitorV2Column + */ + columnPath?: MonitorV2ColumnPath; + /** + * + * @type {MonitorV2CorrelationTag} + * @memberof MonitorV2Column + */ + correlationTag?: MonitorV2CorrelationTag; +} +/** + * + * @export + * @interface MonitorV2ColumnComparison + */ +export interface MonitorV2ColumnComparison { + /** + * + * @type {Array} + * @memberof MonitorV2ColumnComparison + */ + compareValues?: Array; + /** + * + * @type {MonitorV2Column} + * @memberof MonitorV2ColumnComparison + */ + column?: MonitorV2Column; +} +/** + * + * @export + * @interface MonitorV2ColumnPath + */ +export interface MonitorV2ColumnPath { + /** + * + * @type {string} + * @memberof MonitorV2ColumnPath + */ + name?: string; + /** + * + * @type {string} + * @memberof MonitorV2ColumnPath + */ + path?: string; +} +/** + * + * @export + * @interface MonitorV2Comparison + */ +export interface MonitorV2Comparison { + /** + * + * @type {MonitorV2ComparisonFunction} + * @memberof MonitorV2Comparison + */ + compareFn?: MonitorV2ComparisonFunction; + /** + * + * @type {PrimitiveValue} + * @memberof MonitorV2Comparison + */ + compareValue?: PrimitiveValue; +} + + +/** + * + * @export + * @interface MonitorV2ComparisonExpression + */ +export interface MonitorV2ComparisonExpression { + /** + * + * @type {MonitorV2BooleanOperator} + * @memberof MonitorV2ComparisonExpression + */ + operator?: MonitorV2BooleanOperator; + /** + * + * @type {Array} + * @memberof MonitorV2ComparisonExpression + */ + subExpressions?: Array; + /** + * + * @type {Array} + * @memberof MonitorV2ComparisonExpression + */ + compareTerms?: Array; +} + + +/** + * + * @export + * @enum {string} + */ +export enum MonitorV2ComparisonFunction { + Contains = 'Contains', + Equal = 'Equal', + Greater = 'Greater', + GreaterOrEqual = 'GreaterOrEqual', + Less = 'Less', + LessOrEqual = 'LessOrEqual', + NotContains = 'NotContains', + NotEqual = 'NotEqual', + NotStartsWith = 'NotStartsWith', + StartsWith = 'StartsWith' +} + +/** + * + * @export + * @interface MonitorV2ComparisonTerm + */ +export interface MonitorV2ComparisonTerm { + /** + * + * @type {MonitorV2Comparison} + * @memberof MonitorV2ComparisonTerm + */ + comparison: MonitorV2Comparison; + /** + * + * @type {MonitorV2Column} + * @memberof MonitorV2ComparisonTerm + */ + column: MonitorV2Column; +} +/** + * Marker on a `MonitorV2Column` indicating that the column is grouping by a + * correlation tag (e.g. `service.name`) rather than a specific physical + * column. The per-column struct is a slim marker that only carries the tag + * name; the resolved `(tag, backing-column)` mapping for every correlation + * tag in the schema lives on `MonitorV2AlertSchema.correlationTags`, which + * is the single source of truth for tag-to-column resolution. + * + * @export + * @interface MonitorV2CorrelationTag + */ +export interface MonitorV2CorrelationTag { + /** + * Correlation tag name, without the leading `#`. The save-time resolver + * expands this into the canonical primary backing column picked by the + * OPAL coalesce ordering and records the `(tag, column)` pair on + * `MonitorV2AlertSchema.correlationTags`; this column itself carries + * only the tag identifier. + * + * @type {string} + * @memberof MonitorV2CorrelationTag + */ + tag?: string; +} +/** + * + * @export + * @interface MonitorV2CountRule + */ +export interface MonitorV2CountRule { + /** + * + * @type {Array} + * @memberof MonitorV2CountRule + */ + compareValues: Array; + /** + * + * @type {Array} + * @memberof MonitorV2CountRule + */ + compareGroups?: Array; +} +/** + * + * @export + * @interface MonitorV2CronSchedule + */ +export interface MonitorV2CronSchedule { + /** + * Crontab configuration for wall-clock scheduled evaluation. + * @type {string} + * @memberof MonitorV2CronSchedule + */ + cronConfig?: string; + /** + * IANA timezone for interpreting cronConfig on the wall clock. + * @type {string} + * @memberof MonitorV2CronSchedule + */ + timezone: string; + /** + * + * @type {MonitorV2CronScheduleAlarmMode} + * @memberof MonitorV2CronSchedule + */ + alarmMode?: MonitorV2CronScheduleAlarmMode; +} + + +/** + * Controls how alarms are emitted across consecutive monitor evaluations. PerRun (the default when omitted) emits an independent zero-duration alarm per firing evaluation. Ongoing causes consecutive evaluations that re-assert the same (group, level) to extend a single ongoing alarm. Setting the value to Ongoing is gated by a customer feature flag. + * + * @export + * @enum {string} + */ +export enum MonitorV2CronScheduleAlarmMode { + PerRun = 'PerRun', + Ongoing = 'Ongoing' +} + +/** + * + * @export + * @interface MonitorV2Definition + */ +export interface MonitorV2Definition { + /** + * + * @type {MultiStageQuery} + * @memberof MonitorV2Definition + */ + inputQuery: MultiStageQuery; + /** + * + * @type {Array} + * @memberof MonitorV2Definition + */ + rules: Array; + /** + * + * @type {string} + * @memberof MonitorV2Definition + */ + lookbackTime?: string; + /** + * + * @type {string} + * @memberof MonitorV2Definition + */ + dataStabilizationDelay?: string; + /** + * + * @type {number} + * @memberof MonitorV2Definition + */ + maxAlertsPerHour?: number; + /** + * + * @type {Array} + * @memberof MonitorV2Definition + */ + groupings?: Array; + /** + * User-specified scheduling preference. When read back via GET, this reflects only what the user explicitly set, not the scheduling mode the backend is actually using. Null or omitted means the system chooses the best mode automatically. To see the resolved scheduling mode, use the top-level effectiveScheduling field instead. + * + * @type {MonitorV2Scheduling} + * @memberof MonitorV2Definition + */ + scheduling?: MonitorV2Scheduling; +} +/** + * + * @export + * @interface MonitorV2EmailAction + */ +export interface MonitorV2EmailAction { + /** + * + * @type {Array} + * @memberof MonitorV2EmailAction + */ + users?: Array; + /** + * + * @type {Array} + * @memberof MonitorV2EmailAction + */ + addresses?: Array; + /** + * + * @type {string} + * @memberof MonitorV2EmailAction + */ + subject: string; + /** + * + * @type {string} + * @memberof MonitorV2EmailAction + */ + body?: string; + /** + * + * @type {object} + * @memberof MonitorV2EmailAction + */ + fragments?: object; +} +/** + * The http type describes the method or verb to use in http webhooks. + * note: As a convenience, the values POST and PUT will be accepted, but converted + * to the enumeration values Post and Put respectively. + * + * @export + * @enum {string} + */ +export enum MonitorV2HttpType { + Post = 'Post', + Put = 'Put' +} + +/** + * + * @export + * @interface MonitorV2LinkColumn + */ +export interface MonitorV2LinkColumn { + /** + * + * @type {string} + * @memberof MonitorV2LinkColumn + */ + name?: string; + /** + * + * @type {MonitorV2LinkColumnMeta} + * @memberof MonitorV2LinkColumn + */ + meta?: MonitorV2LinkColumnMeta; +} +/** + * + * @export + * @interface MonitorV2LinkColumnMeta + */ +export interface MonitorV2LinkColumnMeta { + /** + * + * @type {Array} + * @memberof MonitorV2LinkColumnMeta + */ + srcFields?: Array; + /** + * + * @type {Array} + * @memberof MonitorV2LinkColumnMeta + */ + dstFields?: Array; + /** + * + * @type {Array} + * @memberof MonitorV2LinkColumnMeta + */ + targetDataset?: Array; +} +/** + * + * @export + * @interface MonitorV2MuteRule + */ +export interface MonitorV2MuteRule { + /** + * + * @type {MonitorV2MuteRuleSchedule} + * @memberof MonitorV2MuteRule + */ + schedule: MonitorV2MuteRuleSchedule; + /** + * + * @type {MonitorV2ComparisonExpression} + * @memberof MonitorV2MuteRule + */ + criteria?: MonitorV2ComparisonExpression; + /** + * + * @type {string} + * @memberof MonitorV2MuteRule + */ + readonly validFrom: string; + /** + * + * @type {string} + * @memberof MonitorV2MuteRule + */ + readonly validTo?: string; + /** + * + * @type {string} + * @memberof MonitorV2MuteRule + */ + monitorID?: string; + /** + * + * @type {MonitorV2MuteRuleMonitor} + * @memberof MonitorV2MuteRule + */ + monitor?: MonitorV2MuteRuleMonitor; + /** + * + * @type {string} + * @memberof MonitorV2MuteRule + */ + readonly id: string; + /** + * + * @type {string} + * @memberof MonitorV2MuteRule + */ + name: string; + /** + * + * @type {boolean} + * @memberof MonitorV2MuteRule + */ + readonly isGlobal?: boolean; + /** + * + * @type {boolean} + * @memberof MonitorV2MuteRule + */ + readonly isConditional?: boolean; +} +/** + * + * @export + * @interface MonitorV2MuteRuleMonitor + */ +export interface MonitorV2MuteRuleMonitor { + /** + * + * @type {string} + * @memberof MonitorV2MuteRuleMonitor + */ + id?: string; + /** + * + * @type {string} + * @memberof MonitorV2MuteRuleMonitor + */ + name?: string; +} +/** + * + * @export + * @interface MonitorV2MuteRuleSchedule + */ +export interface MonitorV2MuteRuleSchedule { + /** + * + * @type {MonitorV2MuteScheduleType} + * @memberof MonitorV2MuteRuleSchedule + */ + type: MonitorV2MuteScheduleType; + /** + * + * @type {MonitorV2OneTimeMuteSchedule} + * @memberof MonitorV2MuteRuleSchedule + */ + oneTime?: MonitorV2OneTimeMuteSchedule; +} + + +/** + * + * @export + * @interface MonitorV2MuteRuleScheduleTerse + */ +export interface MonitorV2MuteRuleScheduleTerse { + /** + * + * @type {MonitorV2MuteScheduleType} + * @memberof MonitorV2MuteRuleScheduleTerse + */ + type: MonitorV2MuteScheduleType; +} + + +/** + * + * @export + * @interface MonitorV2MuteRuleTerse + */ +export interface MonitorV2MuteRuleTerse { + /** + * + * @type {MonitorV2MuteRuleScheduleTerse} + * @memberof MonitorV2MuteRuleTerse + */ + schedule: MonitorV2MuteRuleScheduleTerse; + /** + * + * @type {string} + * @memberof MonitorV2MuteRuleTerse + */ + readonly validFrom: string; + /** + * + * @type {string} + * @memberof MonitorV2MuteRuleTerse + */ + readonly validTo?: string; + /** + * + * @type {string} + * @memberof MonitorV2MuteRuleTerse + */ + monitorID?: string; + /** + * + * @type {string} + * @memberof MonitorV2MuteRuleTerse + */ + readonly id: string; + /** + * + * @type {string} + * @memberof MonitorV2MuteRuleTerse + */ + name: string; + /** + * + * @type {boolean} + * @memberof MonitorV2MuteRuleTerse + */ + readonly isGlobal?: boolean; + /** + * + * @type {boolean} + * @memberof MonitorV2MuteRuleTerse + */ + readonly isConditional?: boolean; +} +/** + * + * @export + * @enum {string} + */ +export enum MonitorV2MuteScheduleType { + OneTime = 'OneTime' +} + +/** + * + * @export + * @interface MonitorV2OneTimeMuteSchedule + */ +export interface MonitorV2OneTimeMuteSchedule { + /** + * + * @type {string} + * @memberof MonitorV2OneTimeMuteSchedule + */ + startTime: string; + /** + * + * @type {string} + * @memberof MonitorV2OneTimeMuteSchedule + */ + endTime?: string; +} +/** + * Request body for `PATCH .../monitors/{id}`. Every property is optional. Only these + * top-level keys participate in the update; see the operation description for merge vs + * whole-value replacement rules. + * + * @export + * @interface MonitorV2PatchRequest + */ +export interface MonitorV2PatchRequest { + /** + * + * @type {string} + * @memberof MonitorV2PatchRequest + */ + name?: string; + /** + * + * @type {boolean} + * @memberof MonitorV2PatchRequest + */ + disabled?: boolean; + /** + * + * @type {string} + * @memberof MonitorV2PatchRequest + */ + description?: string; + /** + * + * @type {MonitorV2RuleKind} + * @memberof MonitorV2PatchRequest + */ + ruleKind?: MonitorV2RuleKind; + /** + * + * @type {MonitorV2Definition} + * @memberof MonitorV2PatchRequest + */ + definition?: MonitorV2Definition; + /** + * + * @type {Array} + * @memberof MonitorV2PatchRequest + */ + actionRules?: Array; +} + + +/** + * + * @export + * @interface MonitorV2PromoteRule + */ +export interface MonitorV2PromoteRule { + /** + * + * @type {Array} + * @memberof MonitorV2PromoteRule + */ + compareColumns?: Array; +} +/** + * + * @export + * @interface MonitorV2Rule + */ +export interface MonitorV2Rule { + /** + * + * @type {MonitorV2AlarmLevel} + * @memberof MonitorV2Rule + */ + level?: MonitorV2AlarmLevel; + /** + * + * @type {MonitorV2CountRule} + * @memberof MonitorV2Rule + */ + count?: MonitorV2CountRule; + /** + * + * @type {MonitorV2ThresholdRule} + * @memberof MonitorV2Rule + */ + threshold?: MonitorV2ThresholdRule; + /** + * + * @type {MonitorV2PromoteRule} + * @memberof MonitorV2Rule + */ + promote?: MonitorV2PromoteRule; +} + + +/** + * + * @export + * @enum {string} + */ +export enum MonitorV2RuleKind { + Count = 'Count', + Promote = 'Promote', + Threshold = 'Threshold' +} + +/** + * Scheduling modes are mutually exclusive. Omit both transform and scheduled for service-chosen defaults. Set transform for continuous transform-driven evaluation, or scheduled for cron-based wall-clock evaluation. + * + * @export + * @interface MonitorV2Scheduling + */ +export interface MonitorV2Scheduling { + /** + * + * @type {MonitorV2TransformSchedule} + * @memberof MonitorV2Scheduling + */ + transform?: MonitorV2TransformSchedule; + /** + * + * @type {MonitorV2CronSchedule} + * @memberof MonitorV2Scheduling + */ + scheduled?: MonitorV2CronSchedule; +} +/** + * + * @export + * @interface MonitorV2Terse + */ +export interface MonitorV2Terse { + /** + * + * @type {string} + * @memberof MonitorV2Terse + */ + id?: string; + /** + * + * @type {string} + * @memberof MonitorV2Terse + */ + name?: string; + /** + * + * @type {string} + * @memberof MonitorV2Terse + */ + description?: string; + /** + * + * @type {boolean} + * @memberof MonitorV2Terse + */ + disabled?: boolean; + /** + * + * @type {number} + * @memberof MonitorV2Terse + */ + monitorVersion?: number; + /** + * + * @type {MonitorV2RuleKind} + * @memberof MonitorV2Terse + */ + ruleKind?: MonitorV2RuleKind; +} + + +/** + * + * @export + * @interface MonitorV2ThresholdRule + */ +export interface MonitorV2ThresholdRule { + /** + * + * @type {Array} + * @memberof MonitorV2ThresholdRule + */ + compareValues: Array; + /** + * + * @type {string} + * @memberof MonitorV2ThresholdRule + */ + valueColumnName: string; + /** + * + * @type {MonitorV2ValueAggregation} + * @memberof MonitorV2ThresholdRule + */ + aggregation: MonitorV2ValueAggregation; + /** + * + * @type {Array} + * @memberof MonitorV2ThresholdRule + */ + compareGroups?: Array; +} + + +/** + * + * @export + * @interface MonitorV2TransformSchedule + */ +export interface MonitorV2TransformSchedule { + /** + * + * @type {string} + * @memberof MonitorV2TransformSchedule + */ + freshnessGoal?: string; +} +/** + * + * @export + * @enum {string} + */ +export enum MonitorV2ValueAggregation { + AllOf = 'AllOf', + AnyOf = 'AnyOf', + AvgOf = 'AvgOf', + SumOf = 'SumOf' +} + +/** + * + * @export + * @interface MonitorV2WebhookAction + */ +export interface MonitorV2WebhookAction { + /** + * + * @type {string} + * @memberof MonitorV2WebhookAction + */ + url: string; + /** + * + * @type {MonitorV2HttpType} + * @memberof MonitorV2WebhookAction + */ + method: MonitorV2HttpType; + /** + * + * @type {Array} + * @memberof MonitorV2WebhookAction + */ + headers?: Array; + /** + * + * @type {string} + * @memberof MonitorV2WebhookAction + */ + body: string; + /** + * + * @type {object} + * @memberof MonitorV2WebhookAction + */ + fragments?: object; +} + + +/** + * + * @export + * @interface MonitorV2WebhookHeader + */ +export interface MonitorV2WebhookHeader { + /** + * + * @type {string} + * @memberof MonitorV2WebhookHeader + */ + header: string; + /** + * + * @type {string} + * @memberof MonitorV2WebhookHeader + */ + value: string; +} +/** + * + * @export + * @interface MultiStageQuery + */ +export interface MultiStageQuery { + /** + * + * @type {string} + * @memberof MultiStageQuery + */ + outputStage: string; + /** + * + * @type {Array} + * @memberof MultiStageQuery + */ + stages: Array; +} +/** + * + * @export + * @interface OAuthExternalIntegrationRef + */ +export interface OAuthExternalIntegrationRef { + /** + * + * @type {string} + * @memberof OAuthExternalIntegrationRef + */ + id: string; +} +/** + * Brief record fields for an ObjectRef. This type is polymorphic: additional fields pointing to specific object types (e.g. dataset, dashboard, monitor) may be added in the future as needed. + * + * @export + * @interface ObjectBrief + */ +export interface ObjectBrief { + /** + * + * @type {string} + * @memberof ObjectBrief + */ + label: string; + /** + * + * @type {string} + * @memberof ObjectBrief + */ + description: string; + /** + * + * @type {string} + * @memberof ObjectBrief + */ + iconUrl: string; + /** + * + * @type {ObjectRef} + * @memberof ObjectBrief + */ + managedBy: ObjectRef | null; +} +/** + * A reference to another resource. Always carries the id; the optional `record` field carries the brief metadata, populated when expand=true. Brief expansion applies to one layer only — fields inside `record` that are themselves ObjectRefs (e.g. `record.managedBy`) are returned id-only, never with their own `record` populated. CEL filter expressions can deeper-resolve via lazy wrapper resolution if needed. + * + * @export + * @interface ObjectRef + */ +export interface ObjectRef { + /** + * + * @type {string} + * @memberof ObjectRef + */ + id: string; + /** + * + * @type {ObjectBrief} + * @memberof ObjectRef + */ + record?: ObjectBrief; +} +/** + * A time range with a start and/or end time. + * @export + * @interface OpenTimeRange + */ +export interface OpenTimeRange { + /** + * + * @type {string} + * @memberof OpenTimeRange + */ + startTime: string | null; + /** + * + * @type {string} + * @memberof OpenTimeRange + */ + endTime: string | null; +} +/** + * + * @export + * @interface ParameterArrayInner + */ +export interface ParameterArrayInner { + /** + * + * @type {string} + * @memberof ParameterArrayInner + */ + id: string; + /** + * + * @type {string} + * @memberof ParameterArrayInner + */ + name?: string; + /** + * + * @type {ParameterArrayInnerDefaultValue} + * @memberof ParameterArrayInner + */ + defaultValue: ParameterArrayInnerDefaultValue; + /** + * + * @type {ParameterArrayInnerValueKind} + * @memberof ParameterArrayInner + */ + valueKind: ParameterArrayInnerValueKind; +} +/** + * + * @export + * @interface ParameterArrayInnerDefaultValue + */ +export interface ParameterArrayInnerDefaultValue { + /** + * + * @type {boolean} + * @memberof ParameterArrayInnerDefaultValue + */ + bool?: boolean; + /** + * + * @type {number} + * @memberof ParameterArrayInnerDefaultValue + */ + float64?: number; + /** + * + * @type {string} + * @memberof ParameterArrayInnerDefaultValue + */ + int64?: string; + /** + * + * @type {string} + * @memberof ParameterArrayInnerDefaultValue + */ + string?: string; + /** + * + * @type {string} + * @memberof ParameterArrayInnerDefaultValue + */ + timestamp?: string; + /** + * + * @type {string} + * @memberof ParameterArrayInnerDefaultValue + */ + duration?: string; + /** + * + * @type {string} + * @memberof ParameterArrayInnerDefaultValue + */ + nullValueType?: string; +} +/** + * + * @export + * @interface ParameterArrayInnerValueKind + */ +export interface ParameterArrayInnerValueKind { + /** + * + * @type {string} + * @memberof ParameterArrayInnerValueKind + */ + type: string; +} +/** + * + * @export + * @interface ParameterValueArrayInner + */ +export interface ParameterValueArrayInner { + /** + * + * @type {string} + * @memberof ParameterValueArrayInner + */ + id: string; + /** + * + * @type {ParameterArrayInnerDefaultValue} + * @memberof ParameterValueArrayInner + */ + value: ParameterArrayInnerDefaultValue; +} +/** + * + * @export + * @interface PollDelegatedLogin200Response + */ +export interface PollDelegatedLogin200Response { + /** + * Whether this HTTP request was valid (does not indicate completion status). + * @type {boolean} + * @memberof PollDelegatedLogin200Response + */ + ok?: boolean; + /** + * If the request has been accepted, denied, or timed out (is settled) then this is true, + * else if we need to poll again, it is false. If the request is not yet settled, the server + * side will wait a bit before returning this response, which allows the client to easily + * implement long polling. + * + * @type {boolean} + * @memberof PollDelegatedLogin200Response + */ + settled: boolean; + /** + * The access key if the request has been accepted. If the request is settled but not + * accepted, it will be empty. Note that only the first request after the login is settled + * will contain the access key, because it is generated once and not stored server side + * (only a hash is stored, for later API request authentication.) This key imbues the same + * powers in the Observe API as are available to the issuing user. + * + * @type {string} + * @memberof PollDelegatedLogin200Response + */ + accessKey?: string; + /** + * A message from the server. In case of error, this may be helpful to display to the user. + * + * @type {string} + * @memberof PollDelegatedLogin200Response + */ + message?: string; +} +/** + * + * @export + * @interface PrimitiveValue + */ +export interface PrimitiveValue { + /** + * + * @type {boolean} + * @memberof PrimitiveValue + */ + bool?: boolean; + /** + * + * @type {number} + * @memberof PrimitiveValue + */ + float64?: number; + /** + * + * @type {string} + * @memberof PrimitiveValue + */ + int64?: string; + /** + * + * @type {string} + * @memberof PrimitiveValue + */ + string?: string; + /** + * + * @type {string} + * @memberof PrimitiveValue + */ + timestamp?: string; + /** + * + * @type {string} + * @memberof PrimitiveValue + */ + duration?: string; + /** + * + * @type {Array} + * @memberof PrimitiveValue + */ + array?: Array; + /** + * + * @type {PrimitiveValueLink} + * @memberof PrimitiveValue + */ + link?: PrimitiveValueLink; + /** + * + * @type {PrimitiveValueDatasetref} + * @memberof PrimitiveValue + */ + datasetref?: PrimitiveValueDatasetref; +} +/** + * + * @export + * @interface PrimitiveValueDatasetref + */ +export interface PrimitiveValueDatasetref { + /** + * + * @type {string} + * @memberof PrimitiveValueDatasetref + */ + datasetId?: string; + /** + * + * @type {string} + * @memberof PrimitiveValueDatasetref + */ + datasetPath?: string; + /** + * + * @type {string} + * @memberof PrimitiveValueDatasetref + */ + stageId?: string; +} +/** + * + * @export + * @interface PrimitiveValueLink + */ +export interface PrimitiveValueLink { + /** + * + * @type {string} + * @memberof PrimitiveValueLink + */ + datasetId?: string; + /** + * + * @type {Array} + * @memberof PrimitiveValueLink + */ + primaryKeyValue?: Array; + /** + * + * @type {string} + * @memberof PrimitiveValueLink + */ + storedLabel?: string; +} +/** + * + * @export + * @interface PrimitiveValueLinkPrimaryKeyValueInner + */ +export interface PrimitiveValueLinkPrimaryKeyValueInner { + /** + * + * @type {string} + * @memberof PrimitiveValueLinkPrimaryKeyValueInner + */ + name?: string; +} +/** + * + * @export + * @interface QueryReferenceTables200Response + */ +export interface QueryReferenceTables200Response { + /** + * Total number of reference tables available, independent of pagination + * @type {number} + * @memberof QueryReferenceTables200Response + */ + totalCount: number; + /** + * List of reference tables that match the query and pagination filters + * @type {Array} + * @memberof QueryReferenceTables200Response + */ + referenceTables: Array; +} +/** + * Reference to an RBAC group, including id, label, and description. + * @export + * @interface RbacGroupRef + */ +export interface RbacGroupRef { + /** + * + * @type {string} + * @memberof RbacGroupRef + */ + id: string; + /** + * Deprecated. For compatibility with legacy APIs. + * @type {string} + * @memberof RbacGroupRef + * @deprecated + */ + legacyId: string; + /** + * + * @type {string} + * @memberof RbacGroupRef + */ + label: string; + /** + * + * @type {string} + * @memberof RbacGroupRef + */ + description: string; +} +/** + * + * @export + * @interface ReferenceTablesTable + */ +export interface ReferenceTablesTable { + /** + * + * @type {string} + * @memberof ReferenceTablesTable + */ + id?: string; + /** + * + * @type {string} + * @memberof ReferenceTablesTable + */ + label?: string; + /** + * + * @type {string} + * @memberof ReferenceTablesTable + */ + description?: string; + /** + * + * @type {string} + * @memberof ReferenceTablesTable + */ + iconUrl?: string; + /** + * + * @type {string} + * @memberof ReferenceTablesTable + */ + managedById?: string; + /** + * + * @type {string} + * @memberof ReferenceTablesTable + */ + customerId?: string; + /** + * + * @type {string} + * @memberof ReferenceTablesTable + */ + createdAt?: string; + /** + * + * @type {User} + * @memberof ReferenceTablesTable + */ + createdBy?: User; + /** + * + * @type {string} + * @memberof ReferenceTablesTable + */ + updatedAt?: string; + /** + * + * @type {User} + * @memberof ReferenceTablesTable + */ + updatedBy?: User; + /** + * + * @type {string} + * @memberof ReferenceTablesTable + */ + datasetId?: string; + /** + * + * @type {string} + * @memberof ReferenceTablesTable + */ + checksum?: string; + /** + * The schema definition of the reference table + * @type {Array} + * @memberof ReferenceTablesTable + */ + schema?: Array; + /** + * The primary key columns of the reference table + * @type {Array} + * @memberof ReferenceTablesTable + */ + primaryKey?: Array; + /** + * The field that should be used for the OPAL label + * @type {string} + * @memberof ReferenceTablesTable + */ + labelField?: string; +} +/** + * + * @export + * @interface ReferenceTablesTableMetadata + */ +export interface ReferenceTablesTableMetadata { + /** + * The label of the reference table. + * @type {string} + * @memberof ReferenceTablesTableMetadata + */ + label: string; + /** + * The description of the reference table. + * @type {string} + * @memberof ReferenceTablesTableMetadata + */ + description?: string; + /** + * The primary key of the reference table. + * @type {Array} + * @memberof ReferenceTablesTableMetadata + */ + primaryKey?: Array; + /** + * The field that should be used for the OPAL label. + * @type {string} + * @memberof ReferenceTablesTableMetadata + */ + labelField?: string; +} +/** + * + * @export + * @interface ReferenceTablesTableMetadataPatch + */ +export interface ReferenceTablesTableMetadataPatch { + /** + * The label of the reference table. + * @type {string} + * @memberof ReferenceTablesTableMetadataPatch + */ + label?: string; + /** + * The description of the reference table. + * @type {string} + * @memberof ReferenceTablesTableMetadataPatch + */ + description?: string; +} +/** + * + * @export + * @interface ReferenceTablesTableSchemaInner + */ +export interface ReferenceTablesTableSchemaInner { + /** + * The name of the field + * @type {string} + * @memberof ReferenceTablesTableSchemaInner + */ + name: string; + /** + * The type of the field (e.g., string, float64, array) + * @type {string} + * @memberof ReferenceTablesTableSchemaInner + */ + type: string; +} +/** + * + * @export + * @interface ServiceAccountCreateRequest + */ +export interface ServiceAccountCreateRequest { + /** + * + * @type {string} + * @memberof ServiceAccountCreateRequest + */ + label: string; + /** + * + * @type {string} + * @memberof ServiceAccountCreateRequest + */ + description?: string; + /** + * The external OAuth binding to create for this service account. + * @type {ServiceAccountExternalOAuth} + * @memberof ServiceAccountCreateRequest + */ + externalOAuth?: ServiceAccountExternalOAuth; +} +/** + * + * @export + * @interface ServiceAccountExternalOAuth + */ +export interface ServiceAccountExternalOAuth { + /** + * + * @type {OAuthExternalIntegrationRef} + * @memberof ServiceAccountExternalOAuth + */ + integration: OAuthExternalIntegrationRef; + /** + * The external identity subject (JWT sub/oid claim) this service account is bound to. + * @type {string} + * @memberof ServiceAccountExternalOAuth + */ + subject: string; +} +/** + * + * @export + * @interface ServiceAccountListResponse + */ +export interface ServiceAccountListResponse { + /** + * + * @type {Array} + * @memberof ServiceAccountListResponse + */ + serviceAccounts: Array; + /** + * + * @type {Meta} + * @memberof ServiceAccountListResponse + */ + meta: Meta; +} +/** + * + * @export + * @interface ServiceAccountResource + */ +export interface ServiceAccountResource { + /** + * + * @type {string} + * @memberof ServiceAccountResource + */ + id: string; + /** + * + * @type {string} + * @memberof ServiceAccountResource + */ + label: string; + /** + * + * @type {string} + * @memberof ServiceAccountResource + */ + description: string; + /** + * + * @type {User} + * @memberof ServiceAccountResource + */ + createdBy: User; + /** + * + * @type {string} + * @memberof ServiceAccountResource + */ + createdAt: string; + /** + * + * @type {User} + * @memberof ServiceAccountResource + */ + updatedBy: User; + /** + * + * @type {string} + * @memberof ServiceAccountResource + */ + updatedAt: string; + /** + * Whether the service account is disabled. Disabling a service account will delete all of its API tokens. + * @type {boolean} + * @memberof ServiceAccountResource + */ + disabled: boolean; + /** + * Number of API tokens for this service account. Includes recently expired and disabled tokens. Only populated when the expand query parameter is set to true. + * @type {number} + * @memberof ServiceAccountResource + */ + apiTokenCount?: number; + /** + * RBAC groups this service account belongs to. Only populated when the expand query parameter is set to true. + * @type {Array} + * @memberof ServiceAccountResource + */ + rbacGroups?: Array; + /** + * + * @type {ServiceAccountExternalOAuth} + * @memberof ServiceAccountResource + */ + externalOAuth: ServiceAccountExternalOAuth | null; +} +/** + * + * @export + * @interface ServiceAccountUpdateRequest + */ +export interface ServiceAccountUpdateRequest { + /** + * + * @type {string} + * @memberof ServiceAccountUpdateRequest + */ + label?: string; + /** + * + * @type {string} + * @memberof ServiceAccountUpdateRequest + */ + description?: string; + /** + * Whether the service account is disabled. Disabling a service account will delete all of its API tokens. + * @type {boolean} + * @memberof ServiceAccountUpdateRequest + */ + disabled?: boolean; + /** + * + * @type {ServiceAccountExternalOAuth} + * @memberof ServiceAccountUpdateRequest + */ + externalOAuth?: ServiceAccountExternalOAuth | null; +} +/** + * + * @export + * @interface StagePresentationInput + */ +export interface StagePresentationInput { + /** + * + * @type {string} + * @memberof StagePresentationInput + */ + limit?: string; + /** + * Turn foreign keys into joined-name columns. + * @type {boolean} + * @memberof StagePresentationInput + */ + linkify?: boolean; + /** + * How many timechart / aggregate buckets to use by default. + * @type {string} + * @memberof StagePresentationInput + */ + wantBuckets?: string; + /** + * How to order the output data. + * @type {Array} + * @memberof StagePresentationInput + */ + orderColumns?: Array; +} +/** + * + * @export + * @interface StagePresentationInputOrderColumnsInner + */ +export interface StagePresentationInputOrderColumnsInner { + /** + * + * @type {string} + * @memberof StagePresentationInputOrderColumnsInner + */ + columnName: string; + /** + * + * @type {boolean} + * @memberof StagePresentationInputOrderColumnsInner + */ + ascending?: boolean; + /** + * + * @type {boolean} + * @memberof StagePresentationInputOrderColumnsInner + */ + nullOrdering?: boolean; +} +/** + * + * @export + * @interface StageQuery + */ +export interface StageQuery { + /** + * + * @type {string} + * @memberof StageQuery + */ + id?: string; + /** + * + * @type {InputDefinition} + * @memberof StageQuery + */ + input: InputDefinition; + /** + * + * @type {string} + * @memberof StageQuery + */ + pipeline: string; +} +/** + * + * @export + * @interface StartDelegatedLogin200Response + */ +export interface StartDelegatedLogin200Response { + /** + * The URL to send the user to in a web browser. + * @type {string} + * @memberof StartDelegatedLogin200Response + */ + url: string; + /** + * A token that can be used to poll the tenant for the status of the token creation. + * This token has some authorization power (because it can be exchanged, once, for a + * real token) so treat it carefully. + * + * @type {string} + * @memberof StartDelegatedLogin200Response + */ + serverToken: string; +} +/** + * + * @export + * @interface StartDelegatedLogin400Response + */ +export interface StartDelegatedLogin400Response { + /** + * Whether this HTTP request was valid (does not indicate completion status). + * @type {boolean} + * @memberof StartDelegatedLogin400Response + */ + ok?: boolean; + /** + * A message from the server. In case of error, this may be helpful to display to the user. + * + * @type {string} + * @memberof StartDelegatedLogin400Response + */ + message?: string; +} +/** + * + * @export + * @interface StartDelegatedLoginRequest + */ +export interface StartDelegatedLoginRequest { + /** + * The email address of the user to mint credentials for. + * @type {string} + * @memberof StartDelegatedLoginRequest + */ + userEmail: string; + /** + * A token generated by the client to identify this particular request. + * We recommend a random alphanumeric string of length 24 characters or + * more to avoid collisions. There is no power or security imbued into + * this token, other than to tell different simultaneous authorization + * requests for the same user apart. + * + * @type {string} + * @memberof StartDelegatedLoginRequest + */ + clientToken: string; + /** + * The identifier of the particular integration making this request. + * Integration should be configured in the Observe back-end, but there + * is currently no UI for this, so you can use the ID of the Observe + * command-line tool `observe-tool-abdaf0`. + * + * @type {string} + * @memberof StartDelegatedLoginRequest + */ + integration: string; +} +/** + * Expanded fields for a storage integration reference. + * Present only when the parent resource is fetched with ?expand=true. + * + * @export + * @interface StorageIntegrationBrief + */ +export interface StorageIntegrationBrief { + /** + * + * @type {string} + * @memberof StorageIntegrationBrief + */ + label: string; + /** + * + * @type {StorageIntegrationType} + * @memberof StorageIntegrationBrief + */ + type: StorageIntegrationType; + /** + * + * @type {StorageIntegrationStorageProvider} + * @memberof StorageIntegrationBrief + */ + storageProvider: StorageIntegrationStorageProvider; +} + + +/** + * A reference to a storage integration, used when embedded in other resources. + * Always includes id. When the parent resource is fetched with ?expand=true, + * the record object is present with label, type, and storageProvider. + * + * @export + * @interface StorageIntegrationRef + */ +export interface StorageIntegrationRef { + /** + * + * @type {string} + * @memberof StorageIntegrationRef + */ + readonly id: string; + /** + * + * @type {StorageIntegrationBrief} + * @memberof StorageIntegrationRef + */ + record?: StorageIntegrationBrief; +} +/** + * + * @export + * @enum {string} + */ +export enum StorageIntegrationStorageProvider { + S3 = 'S3' +} + +/** + * + * @export + * @enum {string} + */ +export enum StorageIntegrationType { + Iceberg = 'Iceberg' +} + +/** + * + * @export + * @interface UpdateReferenceTable200Response + */ +export interface UpdateReferenceTable200Response { + /** + * Success message + * @type {string} + * @memberof UpdateReferenceTable200Response + */ + message: string; +} +/** + * + * @export + * @interface User + */ +export interface User { + /** + * + * @type {string} + * @memberof User + */ + id: string; + /** + * + * @type {string} + * @memberof User + */ + label?: string; + /** + * + * @type {string} + * @memberof User + */ + timezone?: string; + /** + * + * @type {string} + * @memberof User + */ + locale?: string; +} diff --git a/src/rest/generated/runtime.ts b/src/rest/generated/runtime.ts new file mode 100644 index 0000000..7612b00 --- /dev/null +++ b/src/rest/generated/runtime.ts @@ -0,0 +1,425 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Observe API + * # Overview Welcome to the Observe API Docs! The Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded. ## Authentication Requests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication: ``` // passing token as bearer token curl -H \"Authorization: Bearer \" https://..com/v1/... ``` + * + * The version of the OpenAPI document: 1.0.230307 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const BASE_PATH = "https://OBSERVE_CUSTOMERID.observeinc.com".replace(/\/+$/, ""); + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw new ResponseError(response, 'Response returned an error code'); + } + + private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign({}, this.configuration.headers, context.headers); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + const initOverrideFn = + typeof initOverrides === "function" + ? initOverrides + : async () => initOverrides; + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + }; + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })) + }; + + let body: any; + if (isFormData(overriddenInit.body) + || (overriddenInit.body instanceof URLSearchParams) + || isBlob(overriddenInit.body)) { + body = overriddenInit.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(overriddenInit.body); + } else { + body = overriddenInit.body; + } + + const init: RequestInit = { + ...overriddenInit, + body + }; + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +}