// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * API Management API Client for Deno * ================================== * * Enables users to discover shadow APIs in existing Google Cloud infrastructure. * * Docs: https://cloud.google.com/apigee/ * Source: https://googleapis.deno.dev/v1/apim:v1alpha.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Enables users to discover shadow APIs in existing Google Cloud * infrastructure. */ export class APIm { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://apim.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Gets information about a location. * * @param name Resource name for the location. */ async projectsLocationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ 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. * * @param name The resource that owns the locations collection, if applicable. */ async projectsLocationsList(name: string, opts: ProjectsLocationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ name }/locations`); 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; } /** * ListApiObservationTags lists all extant tags on any observation in the * given project. * * @param parent Required. The parent, which owns this collection of tags. Format: projects/{project}/locations/{location} */ async projectsLocationsListApiObservationTags(parent: string, opts: ProjectsLocationsListApiObservationTagsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ parent }:listApiObservationTags`); 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 ListApiObservationTagsResponse; } /** * GetApiOperation retrieves a single ApiOperation by name. * * @param name Required. The name of the ApiOperation to retrieve. Format: projects/{project}/locations/{location}/observationJobs/{observation_job}/apiObservations/{api_observation}/apiOperation/{api_operation} */ async projectsLocationsObservationJobsApiObservationsApiOperationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeApiOperation(data); } /** * ListApiOperations gets all ApiOperations for a given project and location * and ObservationJob and ApiObservation. * * @param parent Required. The parent, which owns this collection of ApiOperations. Format: projects/{project}/locations/{location}/observationJobs/{observation_job}/apiObservations/{api_observation} */ async projectsLocationsObservationJobsApiObservationsApiOperationsList(parent: string, opts: ProjectsLocationsObservationJobsApiObservationsApiOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/apiOperations`); 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 deserializeListApiOperationsResponse(data); } /** * BatchEditTagsApiObservations adds or removes Tags for ApiObservations. * * @param parent Required. The parent resource shared by all ApiObservations being edited. Format: projects/{project}/locations/{location}/observationJobs/{observation_job} */ async projectsLocationsObservationJobsApiObservationsBatchEditTags(parent: string, req: BatchEditTagsApiObservationsRequest): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/apiObservations:batchEditTags`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeBatchEditTagsApiObservationsResponse(data); } /** * GetApiObservation retrieves a single ApiObservation by name. * * @param name Required. The name of the ApiObservation to retrieve. Format: projects/{project}/locations/{location}/observationJobs/{observation_job}/apiObservations/{api_observation} */ async projectsLocationsObservationJobsApiObservationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeApiObservation(data); } /** * ListApiObservations gets all ApiObservations for a given project and * location and ObservationJob. * * @param parent Required. The parent, which owns this collection of ApiObservations. Format: projects/{project}/locations/{location}/observationJobs/{observation_job} */ async projectsLocationsObservationJobsApiObservationsList(parent: string, opts: ProjectsLocationsObservationJobsApiObservationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/apiObservations`); 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 deserializeListApiObservationsResponse(data); } /** * CreateObservationJob creates a new ObservationJob but does not have any * effecton its own. It is a configuration that can be used in an Observation * Job to collect data about existing APIs. * * @param parent Required. The parent resource where this ObservationJob will be created. Format: projects/{project}/locations/{location} */ async projectsLocationsObservationJobsCreate(parent: string, req: ObservationJob, opts: ProjectsLocationsObservationJobsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/observationJobs`); if (opts.observationJobId !== undefined) { url.searchParams.append("observationJobId", String(opts.observationJobId)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * DeleteObservationJob deletes an ObservationJob. This method will fail if * the observation job is currently being used by any ObservationSource, even * if not enabled. * * @param name Required. Name of the resource Format: projects/{project}/locations/{location}/observationJobs/{observation_job} */ async projectsLocationsObservationJobsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Disables the given ObservationJob. * * @param name Required. The name of the ObservationJob to disable. Format: projects/{project}/locations/{location}/observationJobs/{job} */ async projectsLocationsObservationJobsDisable(name: string, req: DisableObservationJobRequest): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ name }:disable`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Enables the given ObservationJob. * * @param name Required. The name of the ObservationJob to enable. Format: projects/{project}/locations/{location}/observationJobs/{job} */ async projectsLocationsObservationJobsEnable(name: string, req: EnableObservationJobRequest): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ name }:enable`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * GetObservationJob retrieves a single ObservationJob by name. * * @param name Required. The name of the ObservationJob to retrieve. Format: projects/{project}/locations/{location}/observationJobs/{job} */ async projectsLocationsObservationJobsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ObservationJob; } /** * ListObservationJobs gets all ObservationJobs for a given project and * location. * * @param parent Required. The parent, which owns this collection of ObservationJobs. Format: projects/{project}/locations/{location} */ async projectsLocationsObservationJobsList(parent: string, opts: ProjectsLocationsObservationJobsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/observationJobs`); 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 ListObservationJobsResponse; } /** * CreateObservationSource creates a new ObservationSource but does not * affect any deployed infrastructure. It is a configuration that can be used * in an Observation Job to collect data about APIs running in user's * dataplane. * * @param parent Required. Value for parent. */ async projectsLocationsObservationSourcesCreate(parent: string, req: ObservationSource, opts: ProjectsLocationsObservationSourcesCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/observationSources`); if (opts.observationSourceId !== undefined) { url.searchParams.append("observationSourceId", String(opts.observationSourceId)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * DeleteObservationSource deletes an observation source. This method will * fail if the observation source is currently being used by any * ObservationJob, even if not enabled. * * @param name Required. Name of the resource Format: projects/{project}/locations/{location}/observationSources/{source} */ async projectsLocationsObservationSourcesDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * GetObservationSource retrieves a single ObservationSource by name. * * @param name Required. The name of the ObservationSource to retrieve. Format: projects/{project}/locations/{location}/observationSources/{source} */ async projectsLocationsObservationSourcesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ObservationSource; } /** * ListObservationSources gets all ObservationSources for a given project and * location. * * @param parent Required. The parent, which owns this collection of ObservationSources. Format: projects/{project}/locations/{location} */ async projectsLocationsObservationSourcesList(parent: string, opts: ProjectsLocationsObservationSourcesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/observationSources`); 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 ListObservationSourcesResponse; } /** * 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}v1alpha/${ 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}v1alpha/${ 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}v1alpha/${ 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}v1alpha/${ 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListOperationsResponse; } } /** * Message describing ApiObservation object */ export interface ApiObservation { /** * The number of observed API Operations. */ apiOperationCount?: bigint; /** * Create time stamp */ createTime?: Date; /** * The hostname of requests processed for this Observation. */ hostname?: string; /** * Last event detected time stamp */ lastEventDetectedTime?: Date; /** * Identifier. Name of resource */ name?: string; /** * The IP address (IPv4 or IPv6) of the origin server that the request was * sent to. This field can include port information. Examples: * `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. */ serverIps?: string[]; /** * Location of the Observation Source, for example "us-central1" or * "europe-west1." */ sourceLocations?: string[]; /** * Style of ApiObservation */ style?: | "STYLE_UNSPECIFIED" | "REST" | "GRPC" | "GRAPHQL"; /** * User-defined tags to organize and sort */ tags?: string[]; /** * Update time stamp */ updateTime?: Date; } function serializeApiObservation(data: any): ApiObservation { return { ...data, apiOperationCount: data["apiOperationCount"] !== undefined ? String(data["apiOperationCount"]) : undefined, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, lastEventDetectedTime: data["lastEventDetectedTime"] !== undefined ? data["lastEventDetectedTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeApiObservation(data: any): ApiObservation { return { ...data, apiOperationCount: data["apiOperationCount"] !== undefined ? BigInt(data["apiOperationCount"]) : undefined, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, lastEventDetectedTime: data["lastEventDetectedTime"] !== undefined ? new Date(data["lastEventDetectedTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Message describing ApiOperation object */ export interface ApiOperation { /** * The number of occurrences of this API Operation. */ count?: bigint; /** * First seen time stamp */ firstSeenTime?: Date; /** * An HTTP Operation. */ httpOperation?: HttpOperation; /** * Last seen time stamp */ lastSeenTime?: Date; /** * Identifier. Name of resource */ name?: string; } function serializeApiOperation(data: any): ApiOperation { return { ...data, count: data["count"] !== undefined ? String(data["count"]) : undefined, firstSeenTime: data["firstSeenTime"] !== undefined ? data["firstSeenTime"].toISOString() : undefined, httpOperation: data["httpOperation"] !== undefined ? serializeHttpOperation(data["httpOperation"]) : undefined, lastSeenTime: data["lastSeenTime"] !== undefined ? data["lastSeenTime"].toISOString() : undefined, }; } function deserializeApiOperation(data: any): ApiOperation { return { ...data, count: data["count"] !== undefined ? BigInt(data["count"]) : undefined, firstSeenTime: data["firstSeenTime"] !== undefined ? new Date(data["firstSeenTime"]) : undefined, httpOperation: data["httpOperation"] !== undefined ? deserializeHttpOperation(data["httpOperation"]) : undefined, lastSeenTime: data["lastSeenTime"] !== undefined ? new Date(data["lastSeenTime"]) : undefined, }; } /** * Message for requesting batch edit tags for ApiObservations */ export interface BatchEditTagsApiObservationsRequest { /** * Required. The request message specifying the resources to update. A * maximum of 1000 apiObservations can be modified in a batch. */ requests?: EditTagsApiObservationsRequest[]; } /** * Message for response to edit Tags for ApiObservations */ export interface BatchEditTagsApiObservationsResponse { /** * ApiObservations that were changed */ apiObservations?: ApiObservation[]; } function serializeBatchEditTagsApiObservationsResponse(data: any): BatchEditTagsApiObservationsResponse { return { ...data, apiObservations: data["apiObservations"] !== undefined ? data["apiObservations"].map((item: any) => (serializeApiObservation(item))) : undefined, }; } function deserializeBatchEditTagsApiObservationsResponse(data: any): BatchEditTagsApiObservationsResponse { return { ...data, apiObservations: data["apiObservations"] !== undefined ? data["apiObservations"].map((item: any) => (deserializeApiObservation(item))) : undefined, }; } /** * The request message for Operations.CancelOperation. */ export interface CancelOperationRequest { } /** * Message for disabling an ObservationJob */ export interface DisableObservationJobRequest { } /** * Message for requesting edit tags for ApiObservation */ export interface EditTagsApiObservationsRequest { /** * Required. Identifier of ApiObservation need to be edit tags Format * example: "apigee.googleapis.com|us-west1|443" */ apiObservationId?: string; /** * Required. Tag actions to be applied */ tagActions?: TagAction[]; } /** * 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 { } /** * Message for enabling an ObservationJob */ export interface EnableObservationJobRequest { } /** * The GCLB observation source. */ export interface GclbObservationSource { /** * Required. The VPC networks where traffic will be observed. All load * balancers within this network will be observed. Currently, this is limited * to only one network. */ pscNetworkConfigs?: GclbObservationSourcePscNetworkConfig[]; } /** * Network information for setting up a PSC connection. */ export interface GclbObservationSourcePscNetworkConfig { /** * Required. The VPC network. Format: * `projects/{project_id}/global/networks/{network}` */ network?: string; /** * Required. The subnetwork in the source region that will be used to connect * to the Cloud Load Balancers via PSC NEGs. Must belong to `network`. Format: * projects/{project_id}/regions/{region}/subnetworks/{subnet} */ subnetwork?: string; } /** * An HTTP-based API Operation, sometimes called a "REST" Operation. */ export interface HttpOperation { /** * HTTP Method. */ method?: | "HTTP_METHOD_UNSPECIFIED" | "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE" | "TRACE" | "OPTIONS" | "CONNECT"; /** * Path of the HTTP request. */ path?: string; /** * Path params of HttpOperation */ pathParams?: HttpOperationPathParam[]; /** * Query params of HttpOperation */ queryParams?: { [key: string]: HttpOperationQueryParam }; /** * Request metadata. */ request?: HttpOperationHttpRequest; /** * Response metadata. */ response?: HttpOperationHttpResponse; } function serializeHttpOperation(data: any): HttpOperation { return { ...data, queryParams: data["queryParams"] !== undefined ? Object.fromEntries(Object.entries(data["queryParams"]).map(([k, v]: [string, any]) => ([k, serializeHttpOperationQueryParam(v)]))) : undefined, request: data["request"] !== undefined ? serializeHttpOperationHttpRequest(data["request"]) : undefined, response: data["response"] !== undefined ? serializeHttpOperationHttpResponse(data["response"]) : undefined, }; } function deserializeHttpOperation(data: any): HttpOperation { return { ...data, queryParams: data["queryParams"] !== undefined ? Object.fromEntries(Object.entries(data["queryParams"]).map(([k, v]: [string, any]) => ([k, deserializeHttpOperationQueryParam(v)]))) : undefined, request: data["request"] !== undefined ? deserializeHttpOperationHttpRequest(data["request"]) : undefined, response: data["response"] !== undefined ? deserializeHttpOperationHttpResponse(data["response"]) : undefined, }; } /** * An aggregation of HTTP header occurrences. */ export interface HttpOperationHeader { /** * The number of occurrences of this Header across transactions. */ count?: bigint; /** * Data type of header */ dataType?: | "DATA_TYPE_UNSPECIFIED" | "BOOL" | "INTEGER" | "FLOAT" | "STRING" | "UUID"; /** * Header name. */ name?: string; } function serializeHttpOperationHeader(data: any): HttpOperationHeader { return { ...data, count: data["count"] !== undefined ? String(data["count"]) : undefined, }; } function deserializeHttpOperationHeader(data: any): HttpOperationHeader { return { ...data, count: data["count"] !== undefined ? BigInt(data["count"]) : undefined, }; } /** * An aggregation of HTTP requests. */ export interface HttpOperationHttpRequest { /** * Unordered map from header name to header metadata */ headers?: { [key: string]: HttpOperationHeader }; } function serializeHttpOperationHttpRequest(data: any): HttpOperationHttpRequest { return { ...data, headers: data["headers"] !== undefined ? Object.fromEntries(Object.entries(data["headers"]).map(([k, v]: [string, any]) => ([k, serializeHttpOperationHeader(v)]))) : undefined, }; } function deserializeHttpOperationHttpRequest(data: any): HttpOperationHttpRequest { return { ...data, headers: data["headers"] !== undefined ? Object.fromEntries(Object.entries(data["headers"]).map(([k, v]: [string, any]) => ([k, deserializeHttpOperationHeader(v)]))) : undefined, }; } /** * An aggregation of HTTP responses. */ export interface HttpOperationHttpResponse { /** * Unordered map from header name to header metadata */ headers?: { [key: string]: HttpOperationHeader }; /** * Map of status code to observed count */ responseCodes?: { [key: string]: bigint }; } function serializeHttpOperationHttpResponse(data: any): HttpOperationHttpResponse { return { ...data, headers: data["headers"] !== undefined ? Object.fromEntries(Object.entries(data["headers"]).map(([k, v]: [string, any]) => ([k, serializeHttpOperationHeader(v)]))) : undefined, responseCodes: data["responseCodes"] !== undefined ? Object.fromEntries(Object.entries(data["responseCodes"]).map(([k, v]: [string, any]) => ([k, String(v)]))) : undefined, }; } function deserializeHttpOperationHttpResponse(data: any): HttpOperationHttpResponse { return { ...data, headers: data["headers"] !== undefined ? Object.fromEntries(Object.entries(data["headers"]).map(([k, v]: [string, any]) => ([k, deserializeHttpOperationHeader(v)]))) : undefined, responseCodes: data["responseCodes"] !== undefined ? Object.fromEntries(Object.entries(data["responseCodes"]).map(([k, v]: [string, any]) => ([k, BigInt(v)]))) : undefined, }; } /** * HTTP Path parameter. */ export interface HttpOperationPathParam { /** * Data type of path param */ dataType?: | "DATA_TYPE_UNSPECIFIED" | "BOOL" | "INTEGER" | "FLOAT" | "STRING" | "UUID"; /** * Segment location in the path, 1-indexed */ position?: number; } /** * An aggregation of HTTP query parameter occurrences. */ export interface HttpOperationQueryParam { /** * The number of occurrences of this query parameter across transactions. */ count?: bigint; /** * Data type of path param */ dataType?: | "DATA_TYPE_UNSPECIFIED" | "BOOL" | "INTEGER" | "FLOAT" | "STRING" | "UUID"; /** * Name of query param */ name?: string; } function serializeHttpOperationQueryParam(data: any): HttpOperationQueryParam { return { ...data, count: data["count"] !== undefined ? String(data["count"]) : undefined, }; } function deserializeHttpOperationQueryParam(data: any): HttpOperationQueryParam { return { ...data, count: data["count"] !== undefined ? BigInt(data["count"]) : undefined, }; } /** * Message for response to listing ApiObservations */ export interface ListApiObservationsResponse { /** * The ApiObservation from the specified project and location and * ObservationJobs. */ apiObservations?: ApiObservation[]; /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; } function serializeListApiObservationsResponse(data: any): ListApiObservationsResponse { return { ...data, apiObservations: data["apiObservations"] !== undefined ? data["apiObservations"].map((item: any) => (serializeApiObservation(item))) : undefined, }; } function deserializeListApiObservationsResponse(data: any): ListApiObservationsResponse { return { ...data, apiObservations: data["apiObservations"] !== undefined ? data["apiObservations"].map((item: any) => (deserializeApiObservation(item))) : undefined, }; } /** * Message for response to listing tags */ export interface ListApiObservationTagsResponse { /** * The tags from the specified project */ apiObservationTags?: string[]; /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; } /** * Message for response to listing ApiOperations */ export interface ListApiOperationsResponse { /** * The ApiOperations from the specified project and location and * ObservationJob and ApiObservation. */ apiOperations?: ApiOperation[]; /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; } function serializeListApiOperationsResponse(data: any): ListApiOperationsResponse { return { ...data, apiOperations: data["apiOperations"] !== undefined ? data["apiOperations"].map((item: any) => (serializeApiOperation(item))) : undefined, }; } function deserializeListApiOperationsResponse(data: any): ListApiOperationsResponse { return { ...data, apiOperations: data["apiOperations"] !== undefined ? data["apiOperations"].map((item: any) => (deserializeApiOperation(item))) : undefined, }; } /** * 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; } /** * Message for response to listing ObservationJobs */ export interface ListObservationJobsResponse { /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * The ObservationJob from the specified project and location. */ observationJobs?: ObservationJob[]; /** * Locations that could not be reached. */ unreachable?: string[]; } /** * Message for response to listing ObservationSources */ export interface ListObservationSourcesResponse { /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * The ObservationSource from the specified project and location. */ observationSources?: ObservationSource[]; /** * Locations that could not be reached. */ unreachable?: 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[]; } /** * 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; } /** * Message describing ObservationJob object */ export interface ObservationJob { /** * Output only. [Output only] Create time stamp */ readonly createTime?: Date; /** * Identifier. name of resource Format: * projects/{project}/locations/{location}/observationJobs/{observation_job} */ name?: string; /** * Optional. These should be of the same kind of source. */ sources?: string[]; /** * Output only. The observation job state */ readonly state?: | "STATE_UNSPECIFIED" | "CREATING" | "ENABLING" | "ENABLED" | "DISABLING" | "DISABLED" | "DELETING" | "ERROR"; /** * Output only. [Output only] Update time stamp */ readonly updateTime?: Date; } /** * Observation source configuration types */ export interface ObservationSource { /** * Output only. [Output only] Create time stamp */ readonly createTime?: Date; /** * The GCLB observation source */ gclbObservationSource?: GclbObservationSource; /** * Identifier. name of resource For MVP, each region can only have 1 source. */ name?: string; /** * Output only. The observation source state */ readonly state?: | "STATE_UNSPECIFIED" | "CREATING" | "CREATED" | "DELETING" | "ERROR"; /** * Output only. [Output only] Update time stamp */ readonly updateTime?: Date; } /** * 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 APIm#projectsLocationsListApiObservationTags. */ export interface ProjectsLocationsListApiObservationTagsOptions { /** * Optional. The maximum number of tags to return. The service may return * fewer than this value. If unspecified, at most 10 tags will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListApiObservationTags` * call. Provide this to retrieve the subsequent page. When paginating, all * other parameters provided to `ListApiObservationTags` must match the call * that provided the page token. */ pageToken?: string; } /** * Additional options for APIm#projectsLocationsList. */ export interface ProjectsLocationsListOptions { /** * 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 * APIm#projectsLocationsObservationJobsApiObservationsApiOperationsList. */ export interface ProjectsLocationsObservationJobsApiObservationsApiOperationsListOptions { /** * Optional. The maximum number of ApiOperations to return. The service may * return fewer than this value. If unspecified, at most 10 ApiOperations will * be returned. The maximum value is 1000; values above 1000 will be coerced * to 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListApiApiOperations` * call. Provide this to retrieve the subsequent page. When paginating, all * other parameters provided to `ListApiApiOperations` must match the call * that provided the page token. */ pageToken?: string; } /** * Additional options for * APIm#projectsLocationsObservationJobsApiObservationsList. */ export interface ProjectsLocationsObservationJobsApiObservationsListOptions { /** * Optional. The maximum number of ApiObservations to return. The service may * return fewer than this value. If unspecified, at most 10 ApiObservations * will be returned. The maximum value is 1000; values above 1000 will be * coerced to 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListApiObservations` * call. Provide this to retrieve the subsequent page. When paginating, all * other parameters provided to `ListApiObservations` must match the call that * provided the page token. */ pageToken?: string; } /** * Additional options for APIm#projectsLocationsObservationJobsCreate. */ export interface ProjectsLocationsObservationJobsCreateOptions { /** * Required. The ID to use for the Observation Job. This value should be 4-63 * characters, and valid characters are /a-z-/. */ observationJobId?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for APIm#projectsLocationsObservationJobsList. */ export interface ProjectsLocationsObservationJobsListOptions { /** * Optional. The maximum number of ObservationJobs to return. The service may * return fewer than this value. If unspecified, at most 10 ObservationJobs * will be returned. The maximum value is 1000; values above 1000 will be * coerced to 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListObservationJobs` * call. Provide this to retrieve the subsequent page. When paginating, all * other parameters provided to `ListObservationJobs` must match the call that * provided the page token. */ pageToken?: string; } /** * Additional options for APIm#projectsLocationsObservationSourcesCreate. */ export interface ProjectsLocationsObservationSourcesCreateOptions { /** * Required. The ID to use for the Observation Source. This value should be * 4-63 characters, and valid characters are /a-z-/. */ observationSourceId?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for APIm#projectsLocationsObservationSourcesList. */ export interface ProjectsLocationsObservationSourcesListOptions { /** * Optional. The maximum number of ObservationSources to return. The service * may return fewer than this value. If unspecified, at most 10 * ObservationSources will be returned. The maximum value is 1000; values * above 1000 will be coerced to 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListObservationSources` * call. Provide this to retrieve the subsequent page. When paginating, all * other parameters provided to `ListObservationSources` must match the call * that provided the page token. */ pageToken?: string; } /** * Additional options for APIm#projectsLocationsOperationsList. */ export interface ProjectsLocationsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * 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; } /** * Message for edit tag action */ export interface TagAction { /** * Required. Action to be applied */ action?: | "ACTION_UNSPECIFIED" | "ADD" | "REMOVE"; /** * Required. Tag to be added or removed */ tag?: string; }