// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Managed Service for Apache Kafka API Client for Deno * ==================================================== * * Manage Apache Kafka clusters and resources. * * Docs: https://cloud.google.com/managed-service-for-apache-kafka/docs * Source: https://googleapis.deno.dev/v1/managedkafka:v1.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Manage Apache Kafka clusters and resources. */ export class ManagedKafka { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://managedkafka.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Incremental update: Adds an acl entry to an acl. Creates the acl if it * does not exist yet. * * @param acl Required. The name of the acl to add the acl entry to. Structured like: `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`. The structure of `acl_id` defines the Resource Pattern (resource_type, resource_name, pattern_type) of the acl. See `Acl.name` for details. */ async projectsLocationsClustersAclsAddAclEntry(acl: string, req: AclEntry): Promise { const url = new URL(`${this.#baseUrl}v1/${ acl }:addAclEntry`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as AddAclEntryResponse; } /** * Creates a new acl in the given project, location, and cluster. * * @param parent Required. The parent cluster in which to create the acl. Structured like `projects/{project}/locations/{location}/clusters/{cluster}`. */ async projectsLocationsClustersAclsCreate(parent: string, req: Acl, opts: ProjectsLocationsClustersAclsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/acls`); if (opts.aclId !== undefined) { url.searchParams.append("aclId", String(opts.aclId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Acl; } /** * Deletes an acl. * * @param name Required. The name of the acl to delete. Structured like: `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`. The structure of `acl_id` defines the Resource Pattern (resource_type, resource_name, pattern_type) of the acl. See `Acl.name` for details. */ async projectsLocationsClustersAclsDelete(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; } /** * Returns the properties of a single acl. * * @param name Required. The name of the acl to return. Structured like: `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`. The structure of `acl_id` defines the Resource Pattern (resource_type, resource_name, pattern_type) of the acl. See `Acl.name` for details. */ async projectsLocationsClustersAclsGet(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 Acl; } /** * Lists the acls in a given cluster. * * @param parent Required. The parent cluster whose acls are to be listed. Structured like `projects/{project}/locations/{location}/clusters/{cluster}`. */ async projectsLocationsClustersAclsList(parent: string, opts: ProjectsLocationsClustersAclsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/acls`); 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 ListAclsResponse; } /** * Updates the properties of a single acl. * * @param name Identifier. The name for the acl. Represents a single Resource Pattern. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id} The structure of `acl_id` defines the Resource Pattern (resource_type, resource_name, pattern_type) of the acl. `acl_id` is structured like one of the following: For acls on the cluster: `cluster` For acls on a single resource within the cluster: `topic/{resource_name}` `consumerGroup/{resource_name}` `transactionalId/{resource_name}` For acls on all resources that match a prefix: `topicPrefixed/{resource_name}` `consumerGroupPrefixed/{resource_name}` `transactionalIdPrefixed/{resource_name}` For acls on all resources of a given type (i.e. the wildcard literal "*"): `allTopics` (represents `topic/*`) `allConsumerGroups` (represents `consumerGroup/*`) `allTransactionalIds` (represents `transactionalId/*`) */ async projectsLocationsClustersAclsPatch(name: string, req: Acl, opts: ProjectsLocationsClustersAclsPatchOptions = {}): Promise { opts = serializeProjectsLocationsClustersAclsPatchOptions(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 Acl; } /** * Incremental update: Removes an acl entry from an acl. Deletes the acl if * its acl entries become empty (i.e. if the removed entry was the last one in * the acl). * * @param acl Required. The name of the acl to remove the acl entry from. Structured like: `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`. The structure of `acl_id` defines the Resource Pattern (resource_type, resource_name, pattern_type) of the acl. See `Acl.name` for details. */ async projectsLocationsClustersAclsRemoveAclEntry(acl: string, req: AclEntry): Promise { const url = new URL(`${this.#baseUrl}v1/${ acl }:removeAclEntry`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as RemoveAclEntryResponse; } /** * Deletes a single consumer group. * * @param name Required. The name of the consumer group to delete. `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`. */ async projectsLocationsClustersConsumerGroupsDelete(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; } /** * Returns the properties of a single consumer group. * * @param name Required. The name of the consumer group whose configuration to return. `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`. */ async projectsLocationsClustersConsumerGroupsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeConsumerGroup(data); } /** * Lists the consumer groups in a given cluster. * * @param parent Required. The parent cluster whose consumer groups are to be listed. Structured like `projects/{project}/locations/{location}/clusters/{cluster}`. */ async projectsLocationsClustersConsumerGroupsList(parent: string, opts: ProjectsLocationsClustersConsumerGroupsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/consumerGroups`); 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 deserializeListConsumerGroupsResponse(data); } /** * Updates the properties of a single consumer group. * * @param name Identifier. The name of the consumer group. The `consumer_group` segment is used when connecting directly to the cluster. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumer_group} */ async projectsLocationsClustersConsumerGroupsPatch(name: string, req: ConsumerGroup, opts: ProjectsLocationsClustersConsumerGroupsPatchOptions = {}): Promise { req = serializeConsumerGroup(req); opts = serializeProjectsLocationsClustersConsumerGroupsPatchOptions(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 deserializeConsumerGroup(data); } /** * Creates a new cluster in a given project and location. * * @param parent Required. The parent region in which to create the cluster. Structured like `projects/{project}/locations/{location}`. */ async projectsLocationsClustersCreate(parent: string, req: Cluster, opts: ProjectsLocationsClustersCreateOptions = {}): Promise { req = serializeCluster(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/clusters`); if (opts.clusterId !== undefined) { url.searchParams.append("clusterId", String(opts.clusterId)); } 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; } /** * Deletes a single cluster. * * @param name Required. The name of the cluster to delete. */ async projectsLocationsClustersDelete(name: string, opts: ProjectsLocationsClustersDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Returns the properties of a single cluster. * * @param name Required. The name of the cluster whose configuration to return. */ async projectsLocationsClustersGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeCluster(data); } /** * Lists the clusters in a given project and location. * * @param parent Required. The parent location whose clusters are to be listed. Structured like `projects/{project}/locations/{location}`. */ async projectsLocationsClustersList(parent: string, opts: ProjectsLocationsClustersListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/clusters`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } 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 deserializeListClustersResponse(data); } /** * Updates the properties of a single cluster. * * @param name Identifier. The name of the cluster. Structured like: projects/{project_number}/locations/{location}/clusters/{cluster_id} */ async projectsLocationsClustersPatch(name: string, req: Cluster, opts: ProjectsLocationsClustersPatchOptions = {}): Promise { req = serializeCluster(req); opts = serializeProjectsLocationsClustersPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } 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; } /** * Creates a new topic in a given project and location. * * @param parent Required. The parent cluster in which to create the topic. Structured like `projects/{project}/locations/{location}/clusters/{cluster}`. */ async projectsLocationsClustersTopicsCreate(parent: string, req: Topic, opts: ProjectsLocationsClustersTopicsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/topics`); if (opts.topicId !== undefined) { url.searchParams.append("topicId", String(opts.topicId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Topic; } /** * Deletes a single topic. * * @param name Required. The name of the topic to delete. `projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}`. */ async projectsLocationsClustersTopicsDelete(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; } /** * Returns the properties of a single topic. * * @param name Required. The name of the topic whose configuration to return. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}. */ async projectsLocationsClustersTopicsGet(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 Topic; } /** * Lists the topics in a given cluster. * * @param parent Required. The parent cluster whose topics are to be listed. Structured like `projects/{project}/locations/{location}/clusters/{cluster}`. */ async projectsLocationsClustersTopicsList(parent: string, opts: ProjectsLocationsClustersTopicsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/topics`); 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 ListTopicsResponse; } /** * Updates the properties of a single topic. * * @param name Identifier. The name of the topic. The `topic` segment is used when connecting directly to the cluster. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic} */ async projectsLocationsClustersTopicsPatch(name: string, req: Topic, opts: ProjectsLocationsClustersTopicsPatchOptions = {}): Promise { opts = serializeProjectsLocationsClustersTopicsPatchOptions(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 Topic; } /** * Creates a new connector in a given Connect cluster. * * @param parent Required. The parent Connect cluster in which to create the connector. Structured like `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`. */ async projectsLocationsConnectClustersConnectorsCreate(parent: string, req: Connector, opts: ProjectsLocationsConnectClustersConnectorsCreateOptions = {}): Promise { req = serializeConnector(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/connectors`); if (opts.connectorId !== undefined) { url.searchParams.append("connectorId", String(opts.connectorId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeConnector(data); } /** * Deletes a connector. * * @param name Required. The name of the connector to delete. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector} */ async projectsLocationsConnectClustersConnectorsDelete(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; } /** * Returns the properties of a single connector. * * @param name Required. The name of the connector whose configuration to return. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector} */ async projectsLocationsConnectClustersConnectorsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeConnector(data); } /** * Lists the connectors in a given Connect cluster. * * @param parent Required. The parent Connect cluster whose connectors are to be listed. Structured like `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`. */ async projectsLocationsConnectClustersConnectorsList(parent: string, opts: ProjectsLocationsConnectClustersConnectorsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/connectors`); 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 deserializeListConnectorsResponse(data); } /** * Updates the properties of a connector. * * @param name Identifier. The name of the connector. Structured like: projects/{project}/locations/{location}/connectClusters/{connect_cluster}/connectors/{connector} */ async projectsLocationsConnectClustersConnectorsPatch(name: string, req: Connector, opts: ProjectsLocationsConnectClustersConnectorsPatchOptions = {}): Promise { req = serializeConnector(req); opts = serializeProjectsLocationsConnectClustersConnectorsPatchOptions(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 deserializeConnector(data); } /** * Pauses the connector and its tasks. * * @param name Required. The name of the connector to pause. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector} */ async projectsLocationsConnectClustersConnectorsPause(name: string, req: PauseConnectorRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:pause`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as PauseConnectorResponse; } /** * Restarts the connector. * * @param name Required. The name of the connector to restart. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector} */ async projectsLocationsConnectClustersConnectorsRestart(name: string, req: RestartConnectorRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:restart`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as RestartConnectorResponse; } /** * Resumes the connector and its tasks. * * @param name Required. The name of the connector to pause. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector} */ async projectsLocationsConnectClustersConnectorsResume(name: string, req: ResumeConnectorRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:resume`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as ResumeConnectorResponse; } /** * Stops the connector. * * @param name Required. The name of the connector to stop. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector} */ async projectsLocationsConnectClustersConnectorsStop(name: string, req: StopConnectorRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:stop`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as StopConnectorResponse; } /** * Creates a new Kafka Connect cluster in a given project and location. * * @param parent Required. The parent project/location in which to create the Kafka Connect cluster. Structured like `projects/{project}/locations/{location}/`. */ async projectsLocationsConnectClustersCreate(parent: string, req: ConnectCluster, opts: ProjectsLocationsConnectClustersCreateOptions = {}): Promise { req = serializeConnectCluster(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/connectClusters`); if (opts.connectClusterId !== undefined) { url.searchParams.append("connectClusterId", String(opts.connectClusterId)); } 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; } /** * Deletes a single Connect cluster. * * @param name Required. The name of the Kafka Connect cluster to delete. Structured like `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`. */ async projectsLocationsConnectClustersDelete(name: string, opts: ProjectsLocationsConnectClustersDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Returns the properties of a single Kafka Connect cluster. * * @param name Required. The name of the Kafka Connect cluster whose configuration to return. Structured like `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`. */ async projectsLocationsConnectClustersGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeConnectCluster(data); } /** * Lists the Kafka Connect clusters in a given project and location. * * @param parent Required. The parent project/location whose Connect clusters are to be listed. Structured like `projects/{project}/locations/{location}`. */ async projectsLocationsConnectClustersList(parent: string, opts: ProjectsLocationsConnectClustersListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/connectClusters`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } 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 deserializeListConnectClustersResponse(data); } /** * Updates the properties of a single Kafka Connect cluster. * * @param name Identifier. The name of the Kafka Connect cluster. Structured like: projects/{project_number}/locations/{location}/connectClusters/{connect_cluster_id} */ async projectsLocationsConnectClustersPatch(name: string, req: ConnectCluster, opts: ProjectsLocationsConnectClustersPatchOptions = {}): Promise { req = serializeConnectCluster(req); opts = serializeProjectsLocationsConnectClustersPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } 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; } /** * 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. * * @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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListOperationsResponse; } } /** * The configuration of access to the Kafka cluster. */ export interface AccessConfig { /** * Required. Virtual Private Cloud (VPC) networks that must be granted direct * access to the Kafka cluster. Minimum of 1 network is required. Maximum 10 * networks can be specified. */ networkConfigs?: NetworkConfig[]; } /** * Represents the set of ACLs for a given Kafka Resource Pattern, which * consists of resource_type, resource_name and pattern_type. */ export interface Acl { /** * Required. The ACL entries that apply to the resource pattern. The maximum * number of allowed entries 100. */ aclEntries?: AclEntry[]; /** * Optional. `etag` is used for concurrency control. An `etag` is returned in * the response to `GetAcl` and `CreateAcl`. Callers are required to put that * etag in the request to `UpdateAcl` to ensure that their change will be * applied to the same version of the acl that exists in the Kafka Cluster. A * terminal 'T' character in the etag indicates that the AclEntries were * truncated; more entries for the Acl exist on the Kafka Cluster, but can't * be returned in the Acl due to repeated field limits. */ etag?: string; /** * Identifier. The name for the acl. Represents a single Resource Pattern. * Structured like: * projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id} * The structure of `acl_id` defines the Resource Pattern (resource_type, * resource_name, pattern_type) of the acl. `acl_id` is structured like one of * the following: For acls on the cluster: `cluster` For acls on a single * resource within the cluster: `topic/{resource_name}` * `consumerGroup/{resource_name}` `transactionalId/{resource_name}` For acls * on all resources that match a prefix: `topicPrefixed/{resource_name}` * `consumerGroupPrefixed/{resource_name}` * `transactionalIdPrefixed/{resource_name}` For acls on all resources of a * given type (i.e. the wildcard literal "*"): `allTopics` (represents * `topic/*`) `allConsumerGroups` (represents `consumerGroup/*`) * `allTransactionalIds` (represents `transactionalId/*`) */ name?: string; /** * Output only. The ACL pattern type derived from the name. One of: LITERAL, * PREFIXED. */ readonly patternType?: string; /** * Output only. The ACL resource name derived from the name. For cluster * resource_type, this is always "kafka-cluster". Can be the wildcard literal * "*". */ readonly resourceName?: string; /** * Output only. The ACL resource type derived from the name. One of: CLUSTER, * TOPIC, GROUP, TRANSACTIONAL_ID. */ readonly resourceType?: string; } /** * Represents the access granted for a given Resource Pattern in an ACL. */ export interface AclEntry { /** * Required. The host. Must be set to "*" for Managed Service for Apache * Kafka. */ host?: string; /** * Required. The operation type. Allowed values are (case insensitive): ALL, * READ, WRITE, CREATE, DELETE, ALTER, DESCRIBE, CLUSTER_ACTION, * DESCRIBE_CONFIGS, ALTER_CONFIGS, and IDEMPOTENT_WRITE. See * https://kafka.apache.org/documentation/#operations_resources_and_protocols * for valid combinations of resource_type and operation for different Kafka * API requests. */ operation?: string; /** * Required. The permission type. Accepted values are (case insensitive): * ALLOW, DENY. */ permissionType?: string; /** * Required. The principal. Specified as Google Cloud account, with the Kafka * StandardAuthorizer prefix "User:". For example: * "User:test-kafka-client@test-project.iam.gserviceaccount.com". Can be the * wildcard "User:*" to refer to all users. */ principal?: string; } /** * Response for AddAclEntry. */ export interface AddAclEntryResponse { /** * The updated acl. */ acl?: Acl; /** * Whether the acl was created as a result of adding the acl entry. */ aclCreated?: boolean; } /** * The request message for Operations.CancelOperation. */ export interface CancelOperationRequest { } /** * A capacity configuration of a Kafka cluster. */ export interface CapacityConfig { /** * Required. The memory to provision for the cluster in bytes. The CPU:memory * ratio (vCPU:GiB) must be between 1:1 and 1:8. Minimum: 3221225472 (3 GiB). */ memoryBytes?: bigint; /** * Required. The number of vCPUs to provision for the cluster. Minimum: 3. */ vcpuCount?: bigint; } function serializeCapacityConfig(data: any): CapacityConfig { return { ...data, memoryBytes: data["memoryBytes"] !== undefined ? String(data["memoryBytes"]) : undefined, vcpuCount: data["vcpuCount"] !== undefined ? String(data["vcpuCount"]) : undefined, }; } function deserializeCapacityConfig(data: any): CapacityConfig { return { ...data, memoryBytes: data["memoryBytes"] !== undefined ? BigInt(data["memoryBytes"]) : undefined, vcpuCount: data["vcpuCount"] !== undefined ? BigInt(data["vcpuCount"]) : undefined, }; } /** * An Apache Kafka cluster deployed in a location. */ export interface Cluster { /** * Required. Capacity configuration for the Kafka cluster. */ capacityConfig?: CapacityConfig; /** * Output only. The time when the cluster was created. */ readonly createTime?: Date; /** * Required. Configuration properties for a Kafka cluster deployed to Google * Cloud Platform. */ gcpConfig?: GcpConfig; /** * Optional. Labels as key value pairs. */ labels?: { [key: string]: string }; /** * Identifier. The name of the cluster. Structured like: * projects/{project_number}/locations/{location}/clusters/{cluster_id} */ name?: string; /** * Optional. Rebalance configuration for the Kafka cluster. */ rebalanceConfig?: RebalanceConfig; /** * Output only. Reserved for future use. */ readonly satisfiesPzi?: boolean; /** * Output only. Reserved for future use. */ readonly satisfiesPzs?: boolean; /** * Output only. The current state of the cluster. */ readonly state?: | "STATE_UNSPECIFIED" | "CREATING" | "ACTIVE" | "DELETING"; /** * Output only. The time when the cluster was last updated. */ readonly updateTime?: Date; } function serializeCluster(data: any): Cluster { return { ...data, capacityConfig: data["capacityConfig"] !== undefined ? serializeCapacityConfig(data["capacityConfig"]) : undefined, }; } function deserializeCluster(data: any): Cluster { return { ...data, capacityConfig: data["capacityConfig"] !== undefined ? deserializeCapacityConfig(data["capacityConfig"]) : undefined, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * The configuration of access to the Kafka Connect cluster. */ export interface ConnectAccessConfig { /** * Required. Virtual Private Cloud (VPC) networks that must be granted direct * access to the Kafka Connect cluster. Minimum of 1 network is required. * Maximum 10 networks can be specified. */ networkConfigs?: ConnectNetworkConfig[]; } /** * An Apache Kafka Connect cluster deployed in a location. */ export interface ConnectCluster { /** * Required. Capacity configuration for the Kafka Connect cluster. */ capacityConfig?: CapacityConfig; /** * Optional. Configurations for the worker that are overridden from the * defaults. The key of the map is a Kafka Connect worker property name, for * example: `exactly.once.source.support`. */ config?: { [key: string]: string }; /** * Output only. The time when the cluster was created. */ readonly createTime?: Date; /** * Required. Configuration properties for a Kafka Connect cluster deployed to * Google Cloud Platform. */ gcpConfig?: ConnectGcpConfig; /** * Required. Immutable. The name of the Kafka cluster this Kafka Connect * cluster is attached to. Structured like: * projects/{project}/locations/{location}/clusters/{cluster} */ kafkaCluster?: string; /** * Optional. Labels as key value pairs. */ labels?: { [key: string]: string }; /** * Identifier. The name of the Kafka Connect cluster. Structured like: * projects/{project_number}/locations/{location}/connectClusters/{connect_cluster_id} */ name?: string; /** * Output only. The current state of the cluster. */ readonly state?: | "STATE_UNSPECIFIED" | "CREATING" | "ACTIVE" | "DELETING"; /** * Output only. The time when the cluster was last updated. */ readonly updateTime?: Date; } function serializeConnectCluster(data: any): ConnectCluster { return { ...data, capacityConfig: data["capacityConfig"] !== undefined ? serializeCapacityConfig(data["capacityConfig"]) : undefined, }; } function deserializeConnectCluster(data: any): ConnectCluster { return { ...data, capacityConfig: data["capacityConfig"] !== undefined ? deserializeCapacityConfig(data["capacityConfig"]) : undefined, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Configuration properties for a Kafka Connect cluster deployed to Google * Cloud Platform. */ export interface ConnectGcpConfig { /** * Required. Access configuration for the Kafka Connect cluster. */ accessConfig?: ConnectAccessConfig; /** * Optional. Secrets to load into workers. Exact SecretVersions from Secret * Manager must be provided -- aliases are not supported. Up to 32 secrets may * be loaded into one cluster. Format: projects//secrets//versions/ */ secretPaths?: string[]; } /** * The configuration of a Virtual Private Cloud (VPC) network that can access * the Kafka Connect cluster. */ export interface ConnectNetworkConfig { /** * Optional. Additional subnets may be specified. They may be in another * region, but must be in the same VPC network. The Connect workers can * communicate with network endpoints in either the primary or additional * subnets. */ additionalSubnets?: string[]; /** * Optional. Additional DNS domain names from the subnet's network to be made * visible to the Connect Cluster. When using MirrorMaker2, it's necessary to * add the bootstrap address's dns domain name of the target cluster to make * it visible to the connector. For example: * my-kafka-cluster.us-central1.managedkafka.my-project.cloud.goog */ dnsDomainNames?: string[]; /** * Required. VPC subnet to make available to the Kafka Connect cluster. * Structured like: * projects/{project}/regions/{region}/subnetworks/{subnet_id} It is used to * create a Private Service Connect (PSC) interface for the Kafka Connect * workers. It must be located in the same region as the Kafka Connect * cluster. The CIDR range of the subnet must be within the IPv4 address * ranges for private networks, as specified in RFC 1918. The primary subnet * CIDR range must have a minimum size of /22 (1024 addresses). */ primarySubnet?: string; } /** * A Kafka Connect connector in a given ConnectCluster. */ export interface Connector { /** * Optional. Connector config as keys/values. The keys of the map are * connector property names, for example: `connector.class`, `tasks.max`, * `key.converter`. */ configs?: { [key: string]: string }; /** * Identifier. The name of the connector. Structured like: * projects/{project}/locations/{location}/connectClusters/{connect_cluster}/connectors/{connector} */ name?: string; /** * Output only. The current state of the connector. */ readonly state?: | "STATE_UNSPECIFIED" | "UNASSIGNED" | "RUNNING" | "PAUSED" | "FAILED" | "RESTARTING" | "STOPPED"; /** * Optional. Restarts the individual tasks of a Connector. */ taskRestartPolicy?: TaskRetryPolicy; } function serializeConnector(data: any): Connector { return { ...data, taskRestartPolicy: data["taskRestartPolicy"] !== undefined ? serializeTaskRetryPolicy(data["taskRestartPolicy"]) : undefined, }; } function deserializeConnector(data: any): Connector { return { ...data, taskRestartPolicy: data["taskRestartPolicy"] !== undefined ? deserializeTaskRetryPolicy(data["taskRestartPolicy"]) : undefined, }; } /** * A Kafka consumer group in a given cluster. */ export interface ConsumerGroup { /** * Identifier. The name of the consumer group. The `consumer_group` segment * is used when connecting directly to the cluster. Structured like: * projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumer_group} */ name?: string; /** * Optional. Metadata for this consumer group for all topics it has metadata * for. The key of the map is a topic name, structured like: * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic} */ topics?: { [key: string]: ConsumerTopicMetadata }; } function serializeConsumerGroup(data: any): ConsumerGroup { return { ...data, topics: data["topics"] !== undefined ? Object.fromEntries(Object.entries(data["topics"]).map(([k, v]: [string, any]) => ([k, serializeConsumerTopicMetadata(v)]))) : undefined, }; } function deserializeConsumerGroup(data: any): ConsumerGroup { return { ...data, topics: data["topics"] !== undefined ? Object.fromEntries(Object.entries(data["topics"]).map(([k, v]: [string, any]) => ([k, deserializeConsumerTopicMetadata(v)]))) : undefined, }; } /** * Metadata for a consumer group corresponding to a specific partition. */ export interface ConsumerPartitionMetadata { /** * Optional. The associated metadata for this partition, or empty if it does * not exist. */ metadata?: string; /** * Required. The current offset for this partition, or 0 if no offset has * been committed. */ offset?: bigint; } function serializeConsumerPartitionMetadata(data: any): ConsumerPartitionMetadata { return { ...data, offset: data["offset"] !== undefined ? String(data["offset"]) : undefined, }; } function deserializeConsumerPartitionMetadata(data: any): ConsumerPartitionMetadata { return { ...data, offset: data["offset"] !== undefined ? BigInt(data["offset"]) : undefined, }; } /** * Metadata for a consumer group corresponding to a specific topic. */ export interface ConsumerTopicMetadata { /** * Optional. Metadata for this consumer group and topic for all partition * indexes it has metadata for. */ partitions?: { [key: string]: ConsumerPartitionMetadata }; } function serializeConsumerTopicMetadata(data: any): ConsumerTopicMetadata { return { ...data, partitions: data["partitions"] !== undefined ? Object.fromEntries(Object.entries(data["partitions"]).map(([k, v]: [string, any]) => ([k, serializeConsumerPartitionMetadata(v)]))) : undefined, }; } function deserializeConsumerTopicMetadata(data: any): ConsumerTopicMetadata { return { ...data, partitions: data["partitions"] !== undefined ? Object.fromEntries(Object.entries(data["partitions"]).map(([k, v]: [string, any]) => ([k, deserializeConsumerPartitionMetadata(v)]))) : undefined, }; } /** * 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 { } /** * Configuration properties for a Kafka cluster deployed to Google Cloud * Platform. */ export interface GcpConfig { /** * Required. Access configuration for the Kafka cluster. */ accessConfig?: AccessConfig; /** * Optional. Immutable. The Cloud KMS Key name to use for encryption. The key * must be located in the same region as the cluster and cannot be changed. * Structured like: * projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}. */ kmsKey?: string; } /** * Response for ListAcls. */ export interface ListAclsResponse { /** * The list of acls in the requested parent. The order of the acls is * unspecified. */ acls?: Acl[]; /** * A token that can be sent as `page_token` to retrieve the next page of * results. If this field is omitted, there are no more results. */ nextPageToken?: string; } /** * Response for ListClusters. */ export interface ListClustersResponse { /** * The list of Clusters in the requested parent. */ clusters?: Cluster[]; /** * A token that can be sent as `page_token` to retrieve the next page of * results. If this field is omitted, there are no more results. */ nextPageToken?: string; /** * Locations that could not be reached. */ unreachable?: string[]; } function serializeListClustersResponse(data: any): ListClustersResponse { return { ...data, clusters: data["clusters"] !== undefined ? data["clusters"].map((item: any) => (serializeCluster(item))) : undefined, }; } function deserializeListClustersResponse(data: any): ListClustersResponse { return { ...data, clusters: data["clusters"] !== undefined ? data["clusters"].map((item: any) => (deserializeCluster(item))) : undefined, }; } /** * Response for ListConnectClusters. */ export interface ListConnectClustersResponse { /** * The list of Connect clusters in the requested parent. */ connectClusters?: ConnectCluster[]; /** * A token that can be sent as `page_token` to retrieve the next page of * results. If this field is omitted, there are no more results. */ nextPageToken?: string; /** * Locations that could not be reached. */ unreachable?: string[]; } function serializeListConnectClustersResponse(data: any): ListConnectClustersResponse { return { ...data, connectClusters: data["connectClusters"] !== undefined ? data["connectClusters"].map((item: any) => (serializeConnectCluster(item))) : undefined, }; } function deserializeListConnectClustersResponse(data: any): ListConnectClustersResponse { return { ...data, connectClusters: data["connectClusters"] !== undefined ? data["connectClusters"].map((item: any) => (deserializeConnectCluster(item))) : undefined, }; } /** * Response for ListConnectors. */ export interface ListConnectorsResponse { /** * The list of connectors in the requested parent. */ connectors?: Connector[]; /** * A token that can be sent as `page_token` to retrieve the next page of * results. If this field is omitted, there are no more results. */ nextPageToken?: string; } function serializeListConnectorsResponse(data: any): ListConnectorsResponse { return { ...data, connectors: data["connectors"] !== undefined ? data["connectors"].map((item: any) => (serializeConnector(item))) : undefined, }; } function deserializeListConnectorsResponse(data: any): ListConnectorsResponse { return { ...data, connectors: data["connectors"] !== undefined ? data["connectors"].map((item: any) => (deserializeConnector(item))) : undefined, }; } /** * Response for ListConsumerGroups. */ export interface ListConsumerGroupsResponse { /** * The list of consumer group in the requested parent. The order of the * consumer groups is unspecified. */ consumerGroups?: ConsumerGroup[]; /** * A token that can be sent as `page_token` to retrieve the next page of * results. If this field is omitted, there are no more results. */ nextPageToken?: string; } function serializeListConsumerGroupsResponse(data: any): ListConsumerGroupsResponse { return { ...data, consumerGroups: data["consumerGroups"] !== undefined ? data["consumerGroups"].map((item: any) => (serializeConsumerGroup(item))) : undefined, }; } function deserializeListConsumerGroupsResponse(data: any): ListConsumerGroupsResponse { return { ...data, consumerGroups: data["consumerGroups"] !== undefined ? data["consumerGroups"].map((item: any) => (deserializeConsumerGroup(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; } /** * 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[]; } /** * Response for ListTopics. */ export interface ListTopicsResponse { /** * A token that can be sent as `page_token` to retrieve the next page of * results. If this field is omitted, there are no more results. */ nextPageToken?: string; /** * The list of topics in the requested parent. The order of the topics is * unspecified. */ topics?: Topic[]; } /** * 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; } /** * The configuration of a Virtual Private Cloud (VPC) network that can access * the Kafka cluster. */ export interface NetworkConfig { /** * Required. Name of the VPC subnet in which to create Private Service * Connect (PSC) endpoints for the Kafka brokers and bootstrap address. * Structured like: * projects/{project}/regions/{region}/subnetworks/{subnet_id} The subnet must * be located in the same region as the Kafka cluster. The project may differ. * Multiple subnets from the same parent network must not be specified. */ subnet?: 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; } /** * Request for PauseConnector. */ export interface PauseConnectorRequest { } /** * Response for PauseConnector. */ export interface PauseConnectorResponse { } /** * Additional options for ManagedKafka#projectsLocationsClustersAclsCreate. */ export interface ProjectsLocationsClustersAclsCreateOptions { /** * Required. The ID to use for the acl, which will become the final component * of the acl's name. The structure of `acl_id` defines the Resource Pattern * (resource_type, resource_name, pattern_type) of the acl. `acl_id` is * structured like one of the following: For acls on the cluster: `cluster` * For acls on a single resource within the cluster: `topic/{resource_name}` * `consumerGroup/{resource_name}` `transactionalId/{resource_name}` For acls * on all resources that match a prefix: `topicPrefixed/{resource_name}` * `consumerGroupPrefixed/{resource_name}` * `transactionalIdPrefixed/{resource_name}` For acls on all resources of a * given type (i.e. the wildcard literal "*"): `allTopics` (represents * `topic/*`) `allConsumerGroups` (represents `consumerGroup/*`) * `allTransactionalIds` (represents `transactionalId/*`) */ aclId?: string; } /** * Additional options for ManagedKafka#projectsLocationsClustersAclsList. */ export interface ProjectsLocationsClustersAclsListOptions { /** * Optional. The maximum number of acls to return. The service may return * fewer than this value. If unset or zero, all acls for the parent is * returned. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListAcls` call. Provide * this to retrieve the subsequent page. When paginating, all other parameters * provided to `ListAcls` must match the call that provided the page token. */ pageToken?: string; } /** * Additional options for ManagedKafka#projectsLocationsClustersAclsPatch. */ export interface ProjectsLocationsClustersAclsPatchOptions { /** * Optional. Field mask is used to specify the fields to be overwritten in * the Acl resource by the update. The fields specified in the update_mask are * relative to the resource, not the full request. A field will be overwritten * if it is in the mask. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsClustersAclsPatchOptions(data: any): ProjectsLocationsClustersAclsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsClustersAclsPatchOptions(data: any): ProjectsLocationsClustersAclsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * ManagedKafka#projectsLocationsClustersConsumerGroupsList. */ export interface ProjectsLocationsClustersConsumerGroupsListOptions { /** * Optional. The maximum number of consumer groups to return. The service may * return fewer than this value. If unset or zero, all consumer groups for the * parent is returned. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListConsumerGroups` * call. Provide this to retrieve the subsequent page. When paginating, all * other parameters provided to `ListConsumerGroups` must match the call that * provided the page token. */ pageToken?: string; } /** * Additional options for * ManagedKafka#projectsLocationsClustersConsumerGroupsPatch. */ export interface ProjectsLocationsClustersConsumerGroupsPatchOptions { /** * Required. Field mask is used to specify the fields to be overwritten in * the ConsumerGroup resource by the update. The fields specified in the * update_mask are relative to the resource, not the full request. A field * will be overwritten if it is in the mask. The mask is required and a value * of * will update all fields. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsClustersConsumerGroupsPatchOptions(data: any): ProjectsLocationsClustersConsumerGroupsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsClustersConsumerGroupsPatchOptions(data: any): ProjectsLocationsClustersConsumerGroupsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for ManagedKafka#projectsLocationsClustersCreate. */ export interface ProjectsLocationsClustersCreateOptions { /** * Required. The ID to use for the cluster, which will become the final * component of the cluster's name. The ID must be 1-63 characters long, and * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with * RFC 1035. This value is structured like: `my-cluster-id`. */ clusterId?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID to avoid duplication of requests. If a request times out or * fails, retrying with the same ID allows the server to recognize the * previous attempt. For at least 60 minutes, the server ignores duplicate * requests bearing the same ID. 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 within 60 minutes of the last request, the * server checks if an original operation with the same request ID was * received. If so, the server ignores the second request. The request ID must * be a valid UUID. A zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for ManagedKafka#projectsLocationsClustersDelete. */ export interface ProjectsLocationsClustersDeleteOptions { /** * Optional. An optional request ID to identify requests. Specify a unique * request ID to avoid duplication of requests. If a request times out or * fails, retrying with the same ID allows the server to recognize the * previous attempt. For at least 60 minutes, the server ignores duplicate * requests bearing the same ID. 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 within 60 minutes of the last request, the * server checks if an original operation with the same request ID was * received. If so, the server ignores the second request. The request ID must * be a valid UUID. A zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for ManagedKafka#projectsLocationsClustersList. */ export interface ProjectsLocationsClustersListOptions { /** * Optional. Filter expression for the result. */ filter?: string; /** * Optional. Order by fields for the result. */ orderBy?: string; /** * Optional. The maximum number of clusters to return. The service may return * fewer than this value. If unspecified, server will pick an appropriate * default. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListClusters` call. * Provide this to retrieve the subsequent page. When paginating, all other * parameters provided to `ListClusters` must match the call that provided the * page token. */ pageToken?: string; } /** * Additional options for ManagedKafka#projectsLocationsClustersPatch. */ export interface ProjectsLocationsClustersPatchOptions { /** * Optional. An optional request ID to identify requests. Specify a unique * request ID to avoid duplication of requests. If a request times out or * fails, retrying with the same ID allows the server to recognize the * previous attempt. For at least 60 minutes, the server ignores duplicate * requests bearing the same ID. 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 within 60 minutes of the last request, the * server checks if an original operation with the same request ID was * received. If so, the server ignores the second request. The request ID must * be a valid UUID. A zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; /** * Required. Field mask is used to specify the fields to be overwritten in * the cluster resource by the update. The fields specified in the update_mask * are relative to the resource, not the full request. A field will be * overwritten if it is in the mask. The mask is required and a value of * * will update all fields. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsClustersPatchOptions(data: any): ProjectsLocationsClustersPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsClustersPatchOptions(data: any): ProjectsLocationsClustersPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for ManagedKafka#projectsLocationsClustersTopicsCreate. */ export interface ProjectsLocationsClustersTopicsCreateOptions { /** * Required. The ID to use for the topic, which will become the final * component of the topic's name. This value is structured like: * `my-topic-name`. */ topicId?: string; } /** * Additional options for ManagedKafka#projectsLocationsClustersTopicsList. */ export interface ProjectsLocationsClustersTopicsListOptions { /** * Optional. The maximum number of topics to return. The service may return * fewer than this value. If unset or zero, all topics for the parent is * returned. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListTopics` call. * Provide this to retrieve the subsequent page. When paginating, all other * parameters provided to `ListTopics` must match the call that provided the * page token. */ pageToken?: string; } /** * Additional options for ManagedKafka#projectsLocationsClustersTopicsPatch. */ export interface ProjectsLocationsClustersTopicsPatchOptions { /** * Required. Field mask is used to specify the fields to be overwritten in * the Topic resource by the update. The fields specified in the update_mask * are relative to the resource, not the full request. A field will be * overwritten if it is in the mask. The mask is required and a value of * * will update all fields. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsClustersTopicsPatchOptions(data: any): ProjectsLocationsClustersTopicsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsClustersTopicsPatchOptions(data: any): ProjectsLocationsClustersTopicsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * ManagedKafka#projectsLocationsConnectClustersConnectorsCreate. */ export interface ProjectsLocationsConnectClustersConnectorsCreateOptions { /** * Required. The ID to use for the connector, which will become the final * component of the connector's name. The ID must be 1-63 characters long, and * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with * RFC 1035. This value is structured like: `my-connector-id`. */ connectorId?: string; } /** * Additional options for * ManagedKafka#projectsLocationsConnectClustersConnectorsList. */ export interface ProjectsLocationsConnectClustersConnectorsListOptions { /** * Optional. The maximum number of connectors to return. The service may * return fewer than this value. If unspecified, server will pick an * appropriate default. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListConnectors` call. * Provide this to retrieve the subsequent page. When paginating, all other * parameters provided to `ListConnectors` must match the call that provided * the page token. */ pageToken?: string; } /** * Additional options for * ManagedKafka#projectsLocationsConnectClustersConnectorsPatch. */ export interface ProjectsLocationsConnectClustersConnectorsPatchOptions { /** * Required. Field mask is used to specify the fields to be overwritten in * the cluster resource by the update. The fields specified in the update_mask * are relative to the resource, not the full request. A field will be * overwritten if it is in the mask. The mask is required and a value of * * will update all fields. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsConnectClustersConnectorsPatchOptions(data: any): ProjectsLocationsConnectClustersConnectorsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsConnectClustersConnectorsPatchOptions(data: any): ProjectsLocationsConnectClustersConnectorsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for ManagedKafka#projectsLocationsConnectClustersCreate. */ export interface ProjectsLocationsConnectClustersCreateOptions { /** * Required. The ID to use for the Connect cluster, which will become the * final component of the cluster's name. The ID must be 1-63 characters long, * and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply * with RFC 1035. This value is structured like: `my-cluster-id`. */ connectClusterId?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID to avoid duplication of requests. If a request times out or * fails, retrying with the same ID allows the server to recognize the * previous attempt. For at least 60 minutes, the server ignores duplicate * requests bearing the same ID. 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 within 60 minutes of the last request, the * server checks if an original operation with the same request ID was * received. If so, the server ignores the second request. The request ID must * be a valid UUID. A zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for ManagedKafka#projectsLocationsConnectClustersDelete. */ export interface ProjectsLocationsConnectClustersDeleteOptions { /** * Optional. An optional request ID to identify requests. Specify a unique * request ID to avoid duplication of requests. If a request times out or * fails, retrying with the same ID allows the server to recognize the * previous attempt. For at least 60 minutes, the server ignores duplicate * requests bearing the same ID. 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 within 60 minutes of the last request, the * server checks if an original operation with the same request ID was * received. If so, the server ignores the second request. The request ID must * be a valid UUID. A zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for ManagedKafka#projectsLocationsConnectClustersList. */ export interface ProjectsLocationsConnectClustersListOptions { /** * Optional. Filter expression for the result. */ filter?: string; /** * Optional. Order by fields for the result. */ orderBy?: string; /** * Optional. The maximum number of Connect clusters to return. The service * may return fewer than this value. If unspecified, server will pick an * appropriate default. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListConnectClusters` * call. Provide this to retrieve the subsequent page. When paginating, all * other parameters provided to `ListConnectClusters` must match the call that * provided the page token. */ pageToken?: string; } /** * Additional options for ManagedKafka#projectsLocationsConnectClustersPatch. */ export interface ProjectsLocationsConnectClustersPatchOptions { /** * Optional. An optional request ID to identify requests. Specify a unique * request ID to avoid duplication of requests. If a request times out or * fails, retrying with the same ID allows the server to recognize the * previous attempt. For at least 60 minutes, the server ignores duplicate * requests bearing the same ID. 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 within 60 minutes of the last request, the * server checks if an original operation with the same request ID was * received. If so, the server ignores the second request. The request ID must * be a valid UUID. A zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; /** * Required. Field mask is used to specify the fields to be overwritten in * the cluster resource by the update. The fields specified in the update_mask * are relative to the resource, not the full request. A field will be * overwritten if it is in the mask. The mask is required and a value of * * will update all fields. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsConnectClustersPatchOptions(data: any): ProjectsLocationsConnectClustersPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsConnectClustersPatchOptions(data: any): ProjectsLocationsConnectClustersPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for ManagedKafka#projectsLocationsList. */ export interface ProjectsLocationsListOptions { /** * Optional. A list of extra location types that should be used as conditions * for controlling the visibility of the locations. */ 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 ManagedKafka#projectsLocationsOperationsList. */ export interface ProjectsLocationsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Defines rebalancing behavior of a Kafka cluster. */ export interface RebalanceConfig { /** * Optional. The rebalance behavior for the cluster. When not specified, * defaults to `NO_REBALANCE`. */ mode?: | "MODE_UNSPECIFIED" | "NO_REBALANCE" | "AUTO_REBALANCE_ON_SCALE_UP"; } /** * Response for RemoveAclEntry. */ export interface RemoveAclEntryResponse { /** * The updated acl. Returned if the removed acl entry was not the last entry * in the acl. */ acl?: Acl; /** * Returned with value true if the removed acl entry was the last entry in * the acl, resulting in acl deletion. */ aclDeleted?: boolean; } /** * Request for RestartConnector. */ export interface RestartConnectorRequest { } /** * Response for RestartConnector. */ export interface RestartConnectorResponse { } /** * Request for ResumeConnector. */ export interface ResumeConnectorRequest { } /** * Response for ResumeConnector. */ export interface ResumeConnectorResponse { } /** * 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; } /** * Request for StopConnector. */ export interface StopConnectorRequest { } /** * Response for StopConnector. */ export interface StopConnectorResponse { } /** * Task Retry Policy is implemented on a best-effort basis. Retry delay will be * exponential based on provided minimum and maximum backoffs. * https://en.wikipedia.org/wiki/Exponential_backoff. Note that the delay * between consecutive task restarts may not always precisely match the * configured settings. This can happen when the ConnectCluster is in * rebalancing state or if the ConnectCluster is unresponsive etc. The default * values for minimum and maximum backoffs are 60 seconds and 30 minutes * respectively. */ export interface TaskRetryPolicy { /** * Optional. The maximum amount of time to wait before retrying a failed * task. This sets an upper bound for the backoff delay. */ maximumBackoff?: number /* Duration */; /** * Optional. The minimum amount of time to wait before retrying a failed * task. This sets a lower bound for the backoff delay. */ minimumBackoff?: number /* Duration */; } function serializeTaskRetryPolicy(data: any): TaskRetryPolicy { return { ...data, maximumBackoff: data["maximumBackoff"] !== undefined ? data["maximumBackoff"] : undefined, minimumBackoff: data["minimumBackoff"] !== undefined ? data["minimumBackoff"] : undefined, }; } function deserializeTaskRetryPolicy(data: any): TaskRetryPolicy { return { ...data, maximumBackoff: data["maximumBackoff"] !== undefined ? data["maximumBackoff"] : undefined, minimumBackoff: data["minimumBackoff"] !== undefined ? data["minimumBackoff"] : undefined, }; } /** * A Kafka topic in a given cluster. */ export interface Topic { /** * Optional. Configurations for the topic that are overridden from the * cluster defaults. The key of the map is a Kafka topic property name, for * example: `cleanup.policy`, `compression.type`. */ configs?: { [key: string]: string }; /** * Identifier. The name of the topic. The `topic` segment is used when * connecting directly to the cluster. Structured like: * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic} */ name?: string; /** * Required. The number of partitions this topic has. The partition count can * only be increased, not decreased. Please note that if partitions are * increased for a topic that has a key, the partitioning logic or the * ordering of the messages will be affected. */ partitionCount?: number; /** * Required. Immutable. The number of replicas of each partition. A * replication factor of 3 is recommended for high availability. */ replicationFactor?: number; }