// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Observability API Client for Deno * ================================= * * Provides functionality for configuring the observability scope, which controls the log, metric, and trace data that you can view. * * Docs: https://cloud.google.com/stackdriver/docs/ * Source: https://googleapis.deno.dev/v1/observability:v1.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Provides functionality for configuring the observability scope, which * controls the log, metric, and trace data that you can view. */ export class Observability { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://observability.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Gets information about a location. * * @param name Resource name for the location. */ async foldersLocationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Location; } /** * Lists information about the supported locations for this service. This * method can be called in two ways: * **List all public locations:** Use the * path `GET /v1/locations`. * **List project-visible locations:** Use the * path `GET /v1/projects/{project_id}/locations`. This may include public * locations as well as private or other locations specifically visible to the * project. * * @param name The resource that owns the locations collection, if applicable. */ async foldersLocationsList(name: string, opts: FoldersLocationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/locations`); if (opts.extraLocationTypes !== undefined) { url.searchParams.append("extraLocationTypes", String(opts.extraLocationTypes)); } if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListLocationsResponse; } /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not guaranteed. * If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, the * operation is not deleted; instead, it becomes an operation with an * Operation.error value with a google.rpc.Status.code of `1`, corresponding * to `Code.CANCELLED`. * * @param name The name of the operation resource to be cancelled. */ async foldersLocationsOperationsCancel(name: string, req: CancelOperationRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:cancel`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Deletes a long-running operation. This method indicates that the client is * no longer interested in the operation result. It does not cancel the * operation. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * * @param name The name of the operation resource to be deleted. */ async foldersLocationsOperationsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * @param name The name of the operation resource. */ async foldersLocationsOperationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Operation; } /** * Lists operations that match the specified filter in the request. If the * server doesn't support this method, it returns `UNIMPLEMENTED`. * * @param name The name of the operation's parent resource. */ async foldersLocationsOperationsList(name: string, opts: FoldersLocationsOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListOperationsResponse; } /** * Gets information about a location. * * @param name Resource name for the location. */ async organizationsLocationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Location; } /** * Lists information about the supported locations for this service. This * method can be called in two ways: * **List all public locations:** Use the * path `GET /v1/locations`. * **List project-visible locations:** Use the * path `GET /v1/projects/{project_id}/locations`. This may include public * locations as well as private or other locations specifically visible to the * project. * * @param name The resource that owns the locations collection, if applicable. */ async organizationsLocationsList(name: string, opts: OrganizationsLocationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/locations`); if (opts.extraLocationTypes !== undefined) { url.searchParams.append("extraLocationTypes", String(opts.extraLocationTypes)); } if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListLocationsResponse; } /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not guaranteed. * If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, the * operation is not deleted; instead, it becomes an operation with an * Operation.error value with a google.rpc.Status.code of `1`, corresponding * to `Code.CANCELLED`. * * @param name The name of the operation resource to be cancelled. */ async organizationsLocationsOperationsCancel(name: string, req: CancelOperationRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:cancel`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Deletes a long-running operation. This method indicates that the client is * no longer interested in the operation result. It does not cancel the * operation. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * * @param name The name of the operation resource to be deleted. */ async organizationsLocationsOperationsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * @param name The name of the operation resource. */ async organizationsLocationsOperationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Operation; } /** * Lists operations that match the specified filter in the request. If the * server doesn't support this method, it returns `UNIMPLEMENTED`. * * @param name The name of the operation's parent resource. */ async organizationsLocationsOperationsList(name: string, opts: OrganizationsLocationsOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListOperationsResponse; } /** * Get a dataset. * * @param name Required. Name of the dataset to retrieve. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID] */ async projectsLocationsBucketsDatasetsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Dataset; } /** * Create a new link. * * @param parent Required. Name of the containing dataset for this link. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID] */ async projectsLocationsBucketsDatasetsLinksCreate(parent: string, req: Link, opts: ProjectsLocationsBucketsDatasetsLinksCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/links`); if (opts.linkId !== undefined) { url.searchParams.append("linkId", String(opts.linkId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Delete a link. * * @param name Required. Name of the link to delete. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/links/[LINK_ID] */ async projectsLocationsBucketsDatasetsLinksDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Get a link. * * @param name Required. Name of the link to retrieve. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/links/[LINK_ID] */ async projectsLocationsBucketsDatasetsLinksGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Link; } /** * List links of a dataset. * * @param parent Required. The parent dataset that owns this collection of links. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID] */ async projectsLocationsBucketsDatasetsLinksList(parent: string, opts: ProjectsLocationsBucketsDatasetsLinksListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/links`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListLinksResponse; } /** * Update a link. * * @param name Identifier. Name of the link. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/links/[LINK_ID] */ async projectsLocationsBucketsDatasetsLinksPatch(name: string, req: Link, opts: ProjectsLocationsBucketsDatasetsLinksPatchOptions = {}): Promise { opts = serializeProjectsLocationsBucketsDatasetsLinksPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Operation; } /** * List datasets of a bucket. * * @param parent Required. The parent bucket that owns this collection of datasets. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID] */ async projectsLocationsBucketsDatasetsList(parent: string, opts: ProjectsLocationsBucketsDatasetsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/datasets`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.showDeleted !== undefined) { url.searchParams.append("showDeleted", String(opts.showDeleted)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListDatasetsResponse; } /** * Get a view. * * @param name Required. Name of the view to retrieve. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/views/[VIEW_ID] */ async projectsLocationsBucketsDatasetsViewsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as View; } /** * List views of a dataset. * * @param parent Required. Dataset whose views are to be listed. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID] */ async projectsLocationsBucketsDatasetsViewsList(parent: string, opts: ProjectsLocationsBucketsDatasetsViewsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/views`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListViewsResponse; } /** * Get bucket resource. * * @param name Required. Name of the bucket to retrieve. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID] */ async projectsLocationsBucketsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Bucket; } /** * List buckets of a project in a particular location. * * @param parent Required. The parent, which owns this collection of buckets. The format is: projects/[PROJECT_ID]/locations/[LOCATION] */ async projectsLocationsBucketsList(parent: string, opts: ProjectsLocationsBucketsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/buckets`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.showDeleted !== undefined) { url.searchParams.append("showDeleted", String(opts.showDeleted)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListBucketsResponse; } /** * Gets information about a location. * * @param name Resource name for the location. */ async projectsLocationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Location; } /** * Lists information about the supported locations for this service. This * method can be called in two ways: * **List all public locations:** Use the * path `GET /v1/locations`. * **List project-visible locations:** Use the * path `GET /v1/projects/{project_id}/locations`. This may include public * locations as well as private or other locations specifically visible to the * project. * * @param name The resource that owns the locations collection, if applicable. */ async projectsLocationsList(name: string, opts: ProjectsLocationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/locations`); if (opts.extraLocationTypes !== undefined) { url.searchParams.append("extraLocationTypes", String(opts.extraLocationTypes)); } if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListLocationsResponse; } /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not guaranteed. * If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, the * operation is not deleted; instead, it becomes an operation with an * Operation.error value with a google.rpc.Status.code of `1`, corresponding * to `Code.CANCELLED`. * * @param name The name of the operation resource to be cancelled. */ async projectsLocationsOperationsCancel(name: string, req: CancelOperationRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:cancel`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Deletes a long-running operation. This method indicates that the client is * no longer interested in the operation result. It does not cancel the * operation. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * * @param name The name of the operation resource to be deleted. */ async projectsLocationsOperationsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * @param name The name of the operation resource. */ async projectsLocationsOperationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Operation; } /** * Lists operations that match the specified filter in the request. If the * server doesn't support this method, it returns `UNIMPLEMENTED`. * * @param name The name of the operation's parent resource. */ async projectsLocationsOperationsList(name: string, opts: ProjectsLocationsOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListOperationsResponse; } /** * Gets details of a single Scope. * * @param name Required. Name of the resource. The format is: projects/{project}/locations/{location}/scopes/{scope} The `{location}` field must be set to `global`. The `{scope}` field must be set to `_Default`. */ async projectsLocationsScopesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Scope; } /** * Updates the parameters of a single Scope. * * @param name Identifier. Name of the resource. The format is: projects/{project}/locations/{location}/scopes/{scope} The `{location}` field must be set to `global`. The `{scope}` field must be set to `_Default`. */ async projectsLocationsScopesPatch(name: string, req: Scope, opts: ProjectsLocationsScopesPatchOptions = {}): Promise { opts = serializeProjectsLocationsScopesPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Scope; } /** * Create a new TraceScope. * * @param parent Required. The full resource name of the location where the trace scope should be created projects/[PROJECT_ID]/locations/[LOCATION_ID] For example: projects/my-project/locations/global */ async projectsLocationsTraceScopesCreate(parent: string, req: TraceScope, opts: ProjectsLocationsTraceScopesCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/traceScopes`); if (opts.traceScopeId !== undefined) { url.searchParams.append("traceScopeId", String(opts.traceScopeId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TraceScope; } /** * Delete a TraceScope. * * @param name Required. The full resource name of the trace scope to delete: projects/[PROJECT_ID]/locations/[LOCATION_ID]/traceScopes/[TRACE_SCOPE_ID] For example: projects/my-project/locations/global/traceScopes/my-trace-scope */ async projectsLocationsTraceScopesDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Get TraceScope resource. * * @param name Required. The resource name of the trace scope: projects/[PROJECT_ID]/locations/[LOCATION_ID]/traceScopes/[TRACE_SCOPE_ID] For example: projects/my-project/locations/global/traceScopes/my-trace-scope */ async projectsLocationsTraceScopesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as TraceScope; } /** * List TraceScopes of a project in a particular location. * * @param parent Required. The full resource name of the location to look for trace scopes: projects/[PROJECT_ID]/locations/[LOCATION_ID] For example: projects/my-project/locations/global */ async projectsLocationsTraceScopesList(parent: string, opts: ProjectsLocationsTraceScopesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/traceScopes`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListTraceScopesResponse; } /** * Update a TraceScope. * * @param name Identifier. The resource name of the trace scope. For example: projects/my-project/locations/global/traceScopes/my-trace-scope */ async projectsLocationsTraceScopesPatch(name: string, req: TraceScope, opts: ProjectsLocationsTraceScopesPatchOptions = {}): Promise { opts = serializeProjectsLocationsTraceScopesPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as TraceScope; } } /** * Bucket configuration for storing observability data. */ export interface Bucket { /** * Optional. Settings for configuring CMEK on a bucket. */ cmekSettings?: CmekSettings; /** * Output only. Create timestamp. */ readonly createTime?: Date; /** * Output only. Delete timestamp. */ readonly deleteTime?: Date; /** * Optional. Description of the bucket. */ description?: string; /** * Optional. User friendly display name. */ displayName?: string; /** * Identifier. Name of the bucket. The format is: * projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID] */ name?: string; /** * Output only. Timestamp when the bucket in soft-deleted state is purged. */ readonly purgeTime?: Date; /** * Output only. Update timestamp. */ readonly updateTime?: Date; } /** * The request message for Operations.CancelOperation. */ export interface CancelOperationRequest { } /** * Settings for configuring CMEK for a bucket. */ export interface CmekSettings { /** * Optional. The resource name for the configured Cloud KMS key. The format * is: * projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY] * For example: * projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key */ kmsKey?: string; /** * Output only. The CryptoKeyVersion resource name for the configured Cloud * KMS key. The format is: * projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION] * For example: * projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1 * This read-only field is used to convey the specific configured * CryptoKeyVersion of the `kms_key` that has been configured. It is populated * when the CMEK settings are bound to a single key version. */ readonly kmsKeyVersion?: string; /** * Output only. The service account used to access the key. */ readonly serviceAccountId?: string; } /** * A dataset is a collection of data that has a specific configuration. A * dataset can be backed by multiple tables. One bucket can have multiple * datasets. */ export interface Dataset { /** * Output only. Create timestamp. */ readonly createTime?: Date; /** * Output only. Delete timestamp. */ readonly deleteTime?: Date; /** * Optional. Description of the dataset. */ description?: string; /** * Optional. User friendly display name. */ displayName?: string; /** * Identifier. Name of the dataset. The format is: * projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID] */ name?: string; /** * Output only. Timestamp when the dataset in soft-deleted state is purged. */ readonly purgeTime?: Date; } /** * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request or * the response type of an API method. For instance: service Foo { rpc * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } */ export interface Empty { } /** * Additional options for Observability#foldersLocationsList. */ export interface FoldersLocationsListOptions { /** * Optional. Do not use this field. It is unsupported and is ignored unless * explicitly documented otherwise. This is primarily for internal usage. */ extraLocationTypes?: string; /** * A filter to narrow down results to a preferred subset. The filtering * language accepts strings like `"displayName=tokyo"`, and is documented in * more detail in [AIP-160](https://google.aip.dev/160). */ filter?: string; /** * The maximum number of results to return. If not set, the service selects a * default. */ pageSize?: number; /** * A page token received from the `next_page_token` field in the response. * Send that page token to receive the subsequent page. */ pageToken?: string; } /** * Additional options for Observability#foldersLocationsOperationsList. */ export interface FoldersLocationsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; /** * When set to `true`, operations that are reachable are returned as normal, * and those that are unreachable are returned in the * ListOperationsResponse.unreachable field. This can only be `true` when * reading across collections. For example, when `parent` is set to * `"projects/example/locations/-"`. This field is not supported by default * and will result in an `UNIMPLEMENTED` error if set unless explicitly * documented otherwise in service or product specific documentation. */ returnPartialSuccess?: boolean; } /** * A link lets a dataset be accessible to BigQuery via usage of linked * datasets. */ export interface Link { /** * Output only. Create timestamp. */ readonly createTime?: Date; /** * Optional. Description of the link. */ description?: string; /** * Optional. A user friendly display name. */ displayName?: string; /** * Identifier. Name of the link. The format is: * projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/links/[LINK_ID] */ name?: string; } /** * Response for listing buckets. */ export interface ListBucketsResponse { /** * Optional. The list of buckets. */ buckets?: Bucket[]; /** * Optional. A token that can be sent as `page_token` to retrieve the next * page. When this field is omitted, there are no subsequent pages. */ nextPageToken?: string; } /** * Response for listing datasets. */ export interface ListDatasetsResponse { /** * The list of datasets. */ datasets?: Dataset[]; /** * A token that can be sent as `page_token` to retrieve the next page. When * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; } /** * Response for listing links. */ export interface ListLinksResponse { /** * The list of links. */ links?: Link[]; /** * Optional. A token that can be sent as `page_token` to retrieve the next * page. When this field is omitted, there are no subsequent pages. */ nextPageToken?: string; } /** * The response message for Locations.ListLocations. */ export interface ListLocationsResponse { /** * A list of locations that matches the specified filter in the request. */ locations?: Location[]; /** * The standard List next-page token. */ nextPageToken?: string; } /** * The response message for Operations.ListOperations. */ export interface ListOperationsResponse { /** * The standard List next-page token. */ nextPageToken?: string; /** * A list of operations that matches the specified filter in the request. */ operations?: Operation[]; /** * Unordered list. Unreachable resources. Populated when the request sets * `ListOperationsRequest.return_partial_success` and reads across * collections. For example, when attempting to list all resources across all * supported locations. */ unreachable?: string[]; } /** * Response for listing TraceScopes. */ export interface ListTraceScopesResponse { /** * Optional. If there might be more results than appear in this response, * then `next_page_token` is included. To get the next set of results, call * the same method again using the value of `next_page_token` as `page_token`. */ nextPageToken?: string; /** * Optional. A list of trace scopes. */ traceScopes?: TraceScope[]; } /** * Response for listing views. */ export interface ListViewsResponse { /** * Optional. A token that can be sent as `page_token` to retrieve the next * page. When this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * The list of views. */ views?: View[]; } /** * A resource that represents a Google Cloud location. */ export interface Location { /** * The friendly name for this location, typically a nearby city name. For * example, "Tokyo". */ displayName?: string; /** * Cross-service attributes for the location. For example * {"cloud.googleapis.com/region": "us-east1"} */ labels?: { [key: string]: string }; /** * The canonical id for this location. For example: `"us-east1"`. */ locationId?: string; /** * Service-specific metadata. For example the available capacity at the given * location. */ metadata?: { [key: string]: any }; /** * Resource name for the location, which may vary between implementations. * For example: `"projects/example-project/locations/us-east1"` */ name?: string; } /** * This resource represents a long-running operation that is the result of a * network API call. */ export interface Operation { /** * If the value is `false`, it means the operation is still in progress. If * `true`, the operation is completed, and either `error` or `response` is * available. */ done?: boolean; /** * The error result of the operation in case of failure or cancellation. */ error?: Status; /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. Some * services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. */ metadata?: { [key: string]: any }; /** * The server-assigned name, which is only unique within the same service * that originally returns it. If you use the default HTTP mapping, the `name` * should be a resource name ending with `operations/{unique_id}`. */ name?: string; /** * The normal, successful response of the operation. If the original method * returns no data on success, such as `Delete`, the response is * `google.protobuf.Empty`. If the original method is standard * `Get`/`Create`/`Update`, the response should be the resource. For other * methods, the response should have the type `XxxResponse`, where `Xxx` is * the original method name. For example, if the original method name is * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */ response?: { [key: string]: any }; } /** * Represents the metadata of the long-running operation. */ export interface OperationMetadata { /** * Output only. API version used to start the operation. */ readonly apiVersion?: string; /** * Output only. The time the operation was created. */ readonly createTime?: Date; /** * Output only. The time the operation finished running. */ readonly endTime?: Date; /** * Output only. Identifies whether the user has requested cancellation of the * operation. Operations that have been cancelled successfully have * Operation.error value with a google.rpc.Status.code of 1, corresponding to * `Code.CANCELLED`. */ readonly requestedCancellation?: boolean; /** * Output only. Human-readable status of the operation, if any. */ readonly statusMessage?: string; /** * Output only. Server-defined resource path for the target of the operation. */ readonly target?: string; /** * Output only. Name of the verb executed by the operation. */ readonly verb?: string; } /** * Additional options for Observability#organizationsLocationsList. */ export interface OrganizationsLocationsListOptions { /** * Optional. Do not use this field. It is unsupported and is ignored unless * explicitly documented otherwise. This is primarily for internal usage. */ extraLocationTypes?: string; /** * A filter to narrow down results to a preferred subset. The filtering * language accepts strings like `"displayName=tokyo"`, and is documented in * more detail in [AIP-160](https://google.aip.dev/160). */ filter?: string; /** * The maximum number of results to return. If not set, the service selects a * default. */ pageSize?: number; /** * A page token received from the `next_page_token` field in the response. * Send that page token to receive the subsequent page. */ pageToken?: string; } /** * Additional options for Observability#organizationsLocationsOperationsList. */ export interface OrganizationsLocationsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; /** * When set to `true`, operations that are reachable are returned as normal, * and those that are unreachable are returned in the * ListOperationsResponse.unreachable field. This can only be `true` when * reading across collections. For example, when `parent` is set to * `"projects/example/locations/-"`. This field is not supported by default * and will result in an `UNIMPLEMENTED` error if set unless explicitly * documented otherwise in service or product specific documentation. */ returnPartialSuccess?: boolean; } /** * Additional options for * Observability#projectsLocationsBucketsDatasetsLinksCreate. */ export interface ProjectsLocationsBucketsDatasetsLinksCreateOptions { /** * Required. Id of the link to create. */ linkId?: string; } /** * Additional options for * Observability#projectsLocationsBucketsDatasetsLinksList. */ export interface ProjectsLocationsBucketsDatasetsLinksListOptions { /** * Optional. The maximum number of links to return. If unspecified, then at * most 100 links are returned. The maximum value is 1000; values above 1000 * are coerced to 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListLinks` call. Provide * this to retrieve the subsequent page. */ pageToken?: string; } /** * Additional options for * Observability#projectsLocationsBucketsDatasetsLinksPatch. */ export interface ProjectsLocationsBucketsDatasetsLinksPatchOptions { /** * Optional. The list of fields to update. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsBucketsDatasetsLinksPatchOptions(data: any): ProjectsLocationsBucketsDatasetsLinksPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsBucketsDatasetsLinksPatchOptions(data: any): ProjectsLocationsBucketsDatasetsLinksPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for Observability#projectsLocationsBucketsDatasetsList. */ export interface ProjectsLocationsBucketsDatasetsListOptions { /** * Optional. The maximum number of datasets to return. If unspecified, then * at most 100 datasets are returned. The maximum value is 1000; values above * 1000 are coerced to 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListDatasets` call. * Provide this to retrieve the subsequent page. */ pageToken?: string; /** * Optional. If true, then the response will include deleted datasets. */ showDeleted?: boolean; } /** * Additional options for * Observability#projectsLocationsBucketsDatasetsViewsList. */ export interface ProjectsLocationsBucketsDatasetsViewsListOptions { /** * Optional. The maximum number of views to return. If unspecified, then at * most 100 views are returned. The maximum value is 1000; values above 1000 * are coerced to 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListViews` call. Provide * this to retrieve the subsequent page. */ pageToken?: string; } /** * Additional options for Observability#projectsLocationsBucketsList. */ export interface ProjectsLocationsBucketsListOptions { /** * Optional. The maximum number of buckets to return. If unspecified, then at * most 100 buckets are returned. The maximum value is 1000; values above 1000 * are coerced to 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListBuckets` call. * Provide this to retrieve the subsequent page. */ pageToken?: string; /** * Optional. If true, then the response will include deleted buckets. */ showDeleted?: boolean; } /** * Additional options for Observability#projectsLocationsList. */ export interface ProjectsLocationsListOptions { /** * Optional. Do not use this field. It is unsupported and is ignored unless * explicitly documented otherwise. This is primarily for internal usage. */ extraLocationTypes?: string; /** * A filter to narrow down results to a preferred subset. The filtering * language accepts strings like `"displayName=tokyo"`, and is documented in * more detail in [AIP-160](https://google.aip.dev/160). */ filter?: string; /** * The maximum number of results to return. If not set, the service selects a * default. */ pageSize?: number; /** * A page token received from the `next_page_token` field in the response. * Send that page token to receive the subsequent page. */ pageToken?: string; } /** * Additional options for Observability#projectsLocationsOperationsList. */ export interface ProjectsLocationsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; /** * When set to `true`, operations that are reachable are returned as normal, * and those that are unreachable are returned in the * ListOperationsResponse.unreachable field. This can only be `true` when * reading across collections. For example, when `parent` is set to * `"projects/example/locations/-"`. This field is not supported by default * and will result in an `UNIMPLEMENTED` error if set unless explicitly * documented otherwise in service or product specific documentation. */ returnPartialSuccess?: boolean; } /** * Additional options for Observability#projectsLocationsScopesPatch. */ export interface ProjectsLocationsScopesPatchOptions { /** * Optional. Field mask is used to specify the fields to be overwritten in * the Scope resource by the update. The fields specified in the update_mask * are relative to the resource, not the full request. A field is overwritten * when it is in the mask. If the user does not provide a mask, then all * fields present in the request are overwritten. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsScopesPatchOptions(data: any): ProjectsLocationsScopesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsScopesPatchOptions(data: any): ProjectsLocationsScopesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for Observability#projectsLocationsTraceScopesCreate. */ export interface ProjectsLocationsTraceScopesCreateOptions { /** * Required. A client-assigned identifier for the trace scope. */ traceScopeId?: string; } /** * Additional options for Observability#projectsLocationsTraceScopesList. */ export interface ProjectsLocationsTraceScopesListOptions { /** * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `next_page_token` in the * response indicates that more results might be available. */ pageSize?: number; /** * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `page_token` must be the value of * `next_page_token` from the previous response. The values of other method * parameters should be identical to those in the previous call. */ pageToken?: string; } /** * Additional options for Observability#projectsLocationsTraceScopesPatch. */ export interface ProjectsLocationsTraceScopesPatchOptions { /** * Optional. The list of fields to update. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsTraceScopesPatchOptions(data: any): ProjectsLocationsTraceScopesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsTraceScopesPatchOptions(data: any): ProjectsLocationsTraceScopesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Message describing Scope object */ export interface Scope { /** * Required. The full resource name of the `LogScope`. For example: * //logging.googleapis.com/projects/myproject/locations/global/logScopes/my-log-scope */ logScope?: string; /** * Identifier. Name of the resource. The format is: * projects/{project}/locations/{location}/scopes/{scope} The `{location}` * field must be set to `global`. The `{scope}` field must be set to * `_Default`. */ name?: string; /** * Required. The resource name of the `TraceScope`. For example: * projects/myproject/locations/global/traceScopes/my-trace-scope */ traceScope?: string; /** * Output only. Update timestamp. Note: The Update timestamp for the default * scope is initially unset. */ readonly updateTime?: Date; } /** * The `Status` type defines a logical error model that is suitable for * different programming environments, including REST APIs and RPC APIs. It is * used by [gRPC](https://github.com/grpc). Each `Status` message contains three * pieces of data: error code, error message, and error details. You can find * out more about this error model and how to work with it in the [API Design * Guide](https://cloud.google.com/apis/design/errors). */ export interface Status { /** * The status code, which should be an enum value of google.rpc.Code. */ code?: number; /** * A list of messages that carry the error details. There is a common set of * message types for APIs to use. */ details?: { [key: string]: any }[]; /** * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the * google.rpc.Status.details field, or localized by the client. */ message?: string; } /** * A trace scope is a collection of resources whose traces are queried * together. */ export interface TraceScope { /** * Output only. The creation timestamp of the trace scope. */ readonly createTime?: Date; /** * Optional. Describes this trace scope. The maximum length of the * description is 8000 characters. */ description?: string; /** * Identifier. The resource name of the trace scope. For example: * projects/my-project/locations/global/traceScopes/my-trace-scope */ name?: string; /** * Required. Names of the projects that are included in this trace scope. * * `projects/[PROJECT_ID]` A trace scope can include a maximum of 20 projects. */ resourceNames?: string[]; /** * Output only. The last update timestamp of the trace scope. */ readonly updateTime?: Date; } /** * A view corresponds to a read-only representation of a subset of the data in * a dataset. */ export interface View { /** * Output only. Create timestamp. */ readonly createTime?: Date; /** * Optional. Description of the view. */ description?: string; /** * Optional. User friendly display name. */ displayName?: string; /** * Identifier. Name of the view. The format is: * projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/views/[VIEW_ID] */ name?: string; /** * Output only. Update timestamp. */ readonly updateTime?: Date; }