// 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.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.view !== undefined) { url.searchParams.append("view", String(opts.view)); } 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, opts: ProjectsLocationsClustersGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.view !== undefined) { url.searchParams.append("view", String(opts.view)); } 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. This * method can be called in two ways: * **List all public locations:** Use the * path `GET /v1/locations`. * **List project-visible locations:** Use the * path `GET /v1/projects/{project_id}/locations`. This may include public * locations as well as private or other locations specifically visible to the * project. * * @param name The resource that owns the locations collection, if applicable. */ async projectsLocationsList(name: string, opts: ProjectsLocationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/locations`); if (opts.extraLocationTypes !== undefined) { url.searchParams.append("extraLocationTypes", String(opts.extraLocationTypes)); } if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListLocationsResponse; } /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not guaranteed. * If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, the * operation is not deleted; instead, it becomes an operation with an * Operation.error value with a google.rpc.Status.code of `1`, corresponding * to `Code.CANCELLED`. * * @param name The name of the operation resource to be cancelled. */ async projectsLocationsOperationsCancel(name: string, req: CancelOperationRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:cancel`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Deletes a long-running operation. This method indicates that the client is * no longer interested in the operation result. It does not cancel the * operation. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * * @param name The name of the operation resource to be deleted. */ async projectsLocationsOperationsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * @param name The name of the operation resource. */ async projectsLocationsOperationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Operation; } /** * Lists operations that match the specified filter in the request. If the * server doesn't support this method, it returns `UNIMPLEMENTED`. * * @param name The name of the operation's parent resource. */ async projectsLocationsOperationsList(name: string, opts: ProjectsLocationsOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListOperationsResponse; } /** * Check compatibility of a schema with all versions or a specific version of * a subject. * * @param name Required. The name of the resource to check compatibility for. The format is either of following: * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/compatibility/subjects/*/versions: Check compatibility with one or more versions of the specified subject. * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/compatibility/subjects/{subject}/versions/{version}: Check compatibility with a specific version of the subject. */ async projectsLocationsSchemaRegistriesCompatibilityCheckCompatibility(name: string, req: CheckCompatibilityRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as CheckCompatibilityResponse; } /** * Delete schema config for a subject. * * @param name Required. The resource name of subject to delete the config for. The format is * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config/{subject} */ async projectsLocationsSchemaRegistriesConfigDelete(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 SchemaConfig; } /** * Get schema config at global level or for a subject. * * @param name Required. The resource name to get the config for. It can be either of following: * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config: Get config at global level. * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config/{subject}: Get config for a specific subject. */ async projectsLocationsSchemaRegistriesConfigGet(name: string, opts: ProjectsLocationsSchemaRegistriesConfigGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.defaultToGlobal !== undefined) { url.searchParams.append("defaultToGlobal", String(opts.defaultToGlobal)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as SchemaConfig; } /** * Update config at global level or for a subject. Creates a * SchemaSubject-level SchemaConfig if it does not exist. * * @param name Required. The resource name to update the config for. It can be either of following: * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config: Update config at global level. * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config/{subject}: Update config for a specific subject. */ async projectsLocationsSchemaRegistriesConfigUpdate(name: string, req: UpdateSchemaConfigRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return data as SchemaConfig; } /** * Check compatibility of a schema with all versions or a specific version of * a subject. * * @param name Required. The name of the resource to check compatibility for. The format is either of following: * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/compatibility/subjects/*/versions: Check compatibility with one or more versions of the specified subject. * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/compatibility/subjects/{subject}/versions/{version}: Check compatibility with a specific version of the subject. */ async projectsLocationsSchemaRegistriesContextsCompatibilityCheckCompatibility(name: string, req: CheckCompatibilityRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as CheckCompatibilityResponse; } /** * Delete schema config for a subject. * * @param name Required. The resource name of subject to delete the config for. The format is * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config/{subject} */ async projectsLocationsSchemaRegistriesContextsConfigDelete(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 SchemaConfig; } /** * Get schema config at global level or for a subject. * * @param name Required. The resource name to get the config for. It can be either of following: * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config: Get config at global level. * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config/{subject}: Get config for a specific subject. */ async projectsLocationsSchemaRegistriesContextsConfigGet(name: string, opts: ProjectsLocationsSchemaRegistriesContextsConfigGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.defaultToGlobal !== undefined) { url.searchParams.append("defaultToGlobal", String(opts.defaultToGlobal)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as SchemaConfig; } /** * Update config at global level or for a subject. Creates a * SchemaSubject-level SchemaConfig if it does not exist. * * @param name Required. The resource name to update the config for. It can be either of following: * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config: Update config at global level. * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config/{subject}: Update config for a specific subject. */ async projectsLocationsSchemaRegistriesContextsConfigUpdate(name: string, req: UpdateSchemaConfigRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return data as SchemaConfig; } /** * Get the context. * * @param name Required. The name of the context to return. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}` */ async projectsLocationsSchemaRegistriesContextsGet(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 Context; } /** * List contexts for a schema registry. * * @param parent Required. The parent of the contexts. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}` */ async projectsLocationsSchemaRegistriesContextsList(parent: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/contexts`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * Delete schema mode for a subject. * * @param name Required. The resource name of subject to delete the mode for. The format is * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/mode/{subject} * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/mode/{subject} */ async projectsLocationsSchemaRegistriesContextsModeDelete(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 SchemaMode; } /** * Get mode at global level or for a subject. * * @param name Required. The resource name of the mode. The format is * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/mode/{subject}: mode for a schema registry, or * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/mode/{subject}: mode for a specific subject in a specific context */ async projectsLocationsSchemaRegistriesContextsModeGet(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 SchemaMode; } /** * Update mode at global level or for a subject. * * @param name Required. The resource name of the mode. The format is * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/mode/{subject}: mode for a schema registry, or * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/mode/{subject}: mode for a specific subject in a specific context */ async projectsLocationsSchemaRegistriesContextsModeUpdate(name: string, req: UpdateSchemaModeRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return data as SchemaMode; } /** * Get the schema for the given schema id. * * @param name Required. The name of the schema to return. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}` */ async projectsLocationsSchemaRegistriesContextsSchemasGet(name: string, opts: ProjectsLocationsSchemaRegistriesContextsSchemasGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.subject !== undefined) { url.searchParams.append("subject", String(opts.subject)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Schema; } /** * Get the schema string for the given schema id. The response will be the * schema string. * * @param name Required. The name of the schema to return. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}` */ async projectsLocationsSchemaRegistriesContextsSchemasGetSchema(name: string, opts: ProjectsLocationsSchemaRegistriesContextsSchemasGetSchemaOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/schema`); if (opts.subject !== undefined) { url.searchParams.append("subject", String(opts.subject)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * List subjects which reference a particular schema id. The response will be * an array of subject names. * * @param parent Required. The schema resource whose associated subjects are to be listed. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/schemas/ids/{schema}` */ async projectsLocationsSchemaRegistriesContextsSchemasSubjectsList(parent: string, opts: ProjectsLocationsSchemaRegistriesContextsSchemasSubjectsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/subjects`); if (opts.deleted !== undefined) { url.searchParams.append("deleted", String(opts.deleted)); } if (opts.subject !== undefined) { url.searchParams.append("subject", String(opts.subject)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * List the supported schema types. The response will be an array of schema * types. * * @param parent Required. The parent schema registry whose schema types are to be listed. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}` */ async projectsLocationsSchemaRegistriesContextsSchemasTypesList(parent: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/schemas/types`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * List the schema versions for the given schema id. The response will be an * array of subject-version pairs as: [{"subject":"subject1", "version":1}, * {"subject":"subject2", "version":2}]. * * @param parent Required. The schema whose schema versions are to be listed. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/schemas/ids/{schema}` */ async projectsLocationsSchemaRegistriesContextsSchemasVersionsList(parent: string, opts: ProjectsLocationsSchemaRegistriesContextsSchemasVersionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/versions`); if (opts.deleted !== undefined) { url.searchParams.append("deleted", String(opts.deleted)); } if (opts.subject !== undefined) { url.searchParams.append("subject", String(opts.subject)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * Delete a subject. The response will be an array of versions of the deleted * subject. * * @param name Required. The name of the subject to delete. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}` */ async projectsLocationsSchemaRegistriesContextsSubjectsDelete(name: string, opts: ProjectsLocationsSchemaRegistriesContextsSubjectsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.permanent !== undefined) { url.searchParams.append("permanent", String(opts.permanent)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeHttpBody(data); } /** * List subjects in the schema registry. The response will be an array of * subject names. * * @param parent Required. The parent schema registry/context whose subjects are to be listed. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}` */ async projectsLocationsSchemaRegistriesContextsSubjectsList(parent: string, opts: ProjectsLocationsSchemaRegistriesContextsSubjectsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/subjects`); if (opts.deleted !== undefined) { url.searchParams.append("deleted", String(opts.deleted)); } if (opts.subjectPrefix !== undefined) { url.searchParams.append("subjectPrefix", String(opts.subjectPrefix)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * Lookup a schema under the specified subject. * * @param parent Required. The subject to lookup the schema in. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}` */ async projectsLocationsSchemaRegistriesContextsSubjectsLookupVersion(parent: string, req: LookupVersionRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as SchemaVersion; } /** * Register a new version under a given subject with the given schema. * * @param parent Required. The subject to create the version for. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}` */ async projectsLocationsSchemaRegistriesContextsSubjectsVersionsCreate(parent: string, req: CreateVersionRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/versions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as CreateVersionResponse; } /** * Delete a version of a subject. The response will be the deleted version * id. * * @param name Required. The name of the subject version to delete. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}` */ async projectsLocationsSchemaRegistriesContextsSubjectsVersionsDelete(name: string, opts: ProjectsLocationsSchemaRegistriesContextsSubjectsVersionsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.permanent !== undefined) { url.searchParams.append("permanent", String(opts.permanent)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeHttpBody(data); } /** * Get a versioned schema (schema with subject/version) of a subject. * * @param name Required. The name of the subject to return versions. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}` */ async projectsLocationsSchemaRegistriesContextsSubjectsVersionsGet(name: string, opts: ProjectsLocationsSchemaRegistriesContextsSubjectsVersionsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.deleted !== undefined) { url.searchParams.append("deleted", String(opts.deleted)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as SchemaVersion; } /** * Get the schema string only for a version of a subject. The response will * be the schema string. * * @param name Required. The name of the subject to return versions. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}` */ async projectsLocationsSchemaRegistriesContextsSubjectsVersionsGetSchema(name: string, opts: ProjectsLocationsSchemaRegistriesContextsSubjectsVersionsGetSchemaOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/schema`); if (opts.deleted !== undefined) { url.searchParams.append("deleted", String(opts.deleted)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * Get all versions of a subject. The response will be an array of versions * of the subject. * * @param parent Required. The subject whose versions are to be listed. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}` */ async projectsLocationsSchemaRegistriesContextsSubjectsVersionsList(parent: string, opts: ProjectsLocationsSchemaRegistriesContextsSubjectsVersionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/versions`); if (opts.deleted !== undefined) { url.searchParams.append("deleted", String(opts.deleted)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * Get a list of IDs of schemas that reference the schema with the given * subject and version. * * @param parent Required. The version to list referenced by. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}` */ async projectsLocationsSchemaRegistriesContextsSubjectsVersionsReferencedbyList(parent: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/referencedby`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * Create a schema registry instance. * * @param parent Required. The parent whose schema registry instance is to be created. Structured like: `projects/{project}/locations/{location}` */ async projectsLocationsSchemaRegistriesCreate(parent: string, req: CreateSchemaRegistryRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/schemaRegistries`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as SchemaRegistry; } /** * Delete a schema registry instance. * * @param name Required. The name of the schema registry instance to delete. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}` */ async projectsLocationsSchemaRegistriesDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Get the schema registry instance. * * @param name Required. The name of the schema registry instance to return. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}` */ async projectsLocationsSchemaRegistriesGet(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 SchemaRegistry; } /** * List schema registries. * * @param parent Required. The parent whose schema registry instances are to be listed. Structured like: `projects/{project}/locations/{location}` */ async projectsLocationsSchemaRegistriesList(parent: string, opts: ProjectsLocationsSchemaRegistriesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/schemaRegistries`); if (opts.view !== undefined) { url.searchParams.append("view", String(opts.view)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListSchemaRegistriesResponse; } /** * Delete schema mode for a subject. * * @param name Required. The resource name of subject to delete the mode for. The format is * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/mode/{subject} * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/mode/{subject} */ async projectsLocationsSchemaRegistriesModeDelete(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 SchemaMode; } /** * Get mode at global level or for a subject. * * @param name Required. The resource name of the mode. The format is * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/mode/{subject}: mode for a schema registry, or * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/mode/{subject}: mode for a specific subject in a specific context */ async projectsLocationsSchemaRegistriesModeGet(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 SchemaMode; } /** * Update mode at global level or for a subject. * * @param name Required. The resource name of the mode. The format is * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/mode/{subject}: mode for a schema registry, or * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/mode/{subject}: mode for a specific subject in a specific context */ async projectsLocationsSchemaRegistriesModeUpdate(name: string, req: UpdateSchemaModeRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return data as SchemaMode; } /** * Get the schema for the given schema id. * * @param name Required. The name of the schema to return. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}` */ async projectsLocationsSchemaRegistriesSchemasGet(name: string, opts: ProjectsLocationsSchemaRegistriesSchemasGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.subject !== undefined) { url.searchParams.append("subject", String(opts.subject)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Schema; } /** * Get the schema string for the given schema id. The response will be the * schema string. * * @param name Required. The name of the schema to return. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}` */ async projectsLocationsSchemaRegistriesSchemasGetSchema(name: string, opts: ProjectsLocationsSchemaRegistriesSchemasGetSchemaOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/schema`); if (opts.subject !== undefined) { url.searchParams.append("subject", String(opts.subject)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * List subjects which reference a particular schema id. The response will be * an array of subject names. * * @param parent Required. The schema resource whose associated subjects are to be listed. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/schemas/ids/{schema}` */ async projectsLocationsSchemaRegistriesSchemasSubjectsList(parent: string, opts: ProjectsLocationsSchemaRegistriesSchemasSubjectsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/subjects`); if (opts.deleted !== undefined) { url.searchParams.append("deleted", String(opts.deleted)); } if (opts.subject !== undefined) { url.searchParams.append("subject", String(opts.subject)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * List the supported schema types. The response will be an array of schema * types. * * @param parent Required. The parent schema registry whose schema types are to be listed. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}` */ async projectsLocationsSchemaRegistriesSchemasTypesList(parent: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/schemas/types`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * List the schema versions for the given schema id. The response will be an * array of subject-version pairs as: [{"subject":"subject1", "version":1}, * {"subject":"subject2", "version":2}]. * * @param parent Required. The schema whose schema versions are to be listed. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/schemas/ids/{schema}` */ async projectsLocationsSchemaRegistriesSchemasVersionsList(parent: string, opts: ProjectsLocationsSchemaRegistriesSchemasVersionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/versions`); if (opts.deleted !== undefined) { url.searchParams.append("deleted", String(opts.deleted)); } if (opts.subject !== undefined) { url.searchParams.append("subject", String(opts.subject)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * Delete a subject. The response will be an array of versions of the deleted * subject. * * @param name Required. The name of the subject to delete. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}` */ async projectsLocationsSchemaRegistriesSubjectsDelete(name: string, opts: ProjectsLocationsSchemaRegistriesSubjectsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.permanent !== undefined) { url.searchParams.append("permanent", String(opts.permanent)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeHttpBody(data); } /** * List subjects in the schema registry. The response will be an array of * subject names. * * @param parent Required. The parent schema registry/context whose subjects are to be listed. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}` */ async projectsLocationsSchemaRegistriesSubjectsList(parent: string, opts: ProjectsLocationsSchemaRegistriesSubjectsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/subjects`); if (opts.deleted !== undefined) { url.searchParams.append("deleted", String(opts.deleted)); } if (opts.subjectPrefix !== undefined) { url.searchParams.append("subjectPrefix", String(opts.subjectPrefix)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * Lookup a schema under the specified subject. * * @param parent Required. The subject to lookup the schema in. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}` */ async projectsLocationsSchemaRegistriesSubjectsLookupVersion(parent: string, req: LookupVersionRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as SchemaVersion; } /** * Register a new version under a given subject with the given schema. * * @param parent Required. The subject to create the version for. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}` */ async projectsLocationsSchemaRegistriesSubjectsVersionsCreate(parent: string, req: CreateVersionRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/versions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as CreateVersionResponse; } /** * Delete a version of a subject. The response will be the deleted version * id. * * @param name Required. The name of the subject version to delete. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}` */ async projectsLocationsSchemaRegistriesSubjectsVersionsDelete(name: string, opts: ProjectsLocationsSchemaRegistriesSubjectsVersionsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.permanent !== undefined) { url.searchParams.append("permanent", String(opts.permanent)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeHttpBody(data); } /** * Get a versioned schema (schema with subject/version) of a subject. * * @param name Required. The name of the subject to return versions. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}` */ async projectsLocationsSchemaRegistriesSubjectsVersionsGet(name: string, opts: ProjectsLocationsSchemaRegistriesSubjectsVersionsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.deleted !== undefined) { url.searchParams.append("deleted", String(opts.deleted)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as SchemaVersion; } /** * Get the schema string only for a version of a subject. The response will * be the schema string. * * @param name Required. The name of the subject to return versions. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}` */ async projectsLocationsSchemaRegistriesSubjectsVersionsGetSchema(name: string, opts: ProjectsLocationsSchemaRegistriesSubjectsVersionsGetSchemaOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/schema`); if (opts.deleted !== undefined) { url.searchParams.append("deleted", String(opts.deleted)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * Get all versions of a subject. The response will be an array of versions * of the subject. * * @param parent Required. The subject whose versions are to be listed. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}` */ async projectsLocationsSchemaRegistriesSubjectsVersionsList(parent: string, opts: ProjectsLocationsSchemaRegistriesSubjectsVersionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/versions`); if (opts.deleted !== undefined) { url.searchParams.append("deleted", String(opts.deleted)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } /** * Get a list of IDs of schemas that reference the schema with the given * subject and version. * * @param parent Required. The version to list referenced by. Structured like: `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}` or `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}` */ async projectsLocationsSchemaRegistriesSubjectsVersionsReferencedbyList(parent: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/referencedby`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpBody(data); } } /** * 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; } /** * Details of a broker in the Kafka cluster. */ export interface BrokerDetails { /** * Output only. The index of the broker. */ readonly brokerIndex?: bigint; /** * Output only. The node id of the broker. */ readonly nodeId?: bigint; /** * Output only. The rack of the broker. */ readonly rack?: string; } /** * 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, }; } /** * A configuration for the Google Certificate Authority Service. */ export interface CertificateAuthorityServiceConfig { /** * Required. The name of the CA pool to pull CA certificates from. Structured * like: projects/{project}/locations/{location}/caPools/{ca_pool}. The CA * pool does not need to be in the same project or location as the Kafka * cluster. */ caPool?: string; } /** * Request for CheckCompatibility. */ export interface CheckCompatibilityRequest { /** * Optional. The schema references used by the schema. */ references?: SchemaReference[]; /** * Required. The schema payload */ schema?: string; /** * Optional. The schema type of the schema. */ schemaType?: | "SCHEMA_TYPE_UNSPECIFIED" | "AVRO" | "JSON" | "PROTOBUF"; /** * Optional. If true, the response will contain the compatibility check * result with reasons for failed checks. The default is false. */ verbose?: boolean; } /** * Response for CheckCompatibility. */ export interface CheckCompatibilityResponse { /** * The compatibility check result. If true, the schema is compatible with the * resource. */ is_compatible?: boolean; /** * Failure reasons if verbose = true. */ messages?: string[]; } /** * An Apache Kafka cluster deployed in a location. */ export interface Cluster { /** * Output only. Only populated when FULL view is requested. Details of each * broker in the cluster. */ readonly brokerDetails?: BrokerDetails[]; /** * 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; /** * Output only. Only populated when FULL view is requested. The Kafka version * of the cluster. */ readonly kafkaVersion?: string; /** * 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" | "UPDATING"; /** * Optional. TLS configuration for the Kafka cluster. */ tlsConfig?: TlsConfig; /** * Optional. UpdateOptions represents options that control how updates to the * cluster are applied. */ updateOptions?: UpdateOptions; /** * 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. Reserved for future use. */ readonly satisfiesPzi?: boolean; /** * Output only. Reserved for future use. */ readonly satisfiesPzs?: boolean; /** * Output only. The current state of the Kafka Connect cluster. */ readonly state?: | "STATE_UNSPECIFIED" | "CREATING" | "ACTIVE" | "DELETING" | "DETACHED"; /** * 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. Deprecated: Managed Kafka Connect clusters can now reach any * endpoint accessible from the primary subnet without the need to define * additional subnets. Please see * https://cloud.google.com/managed-service-for-apache-kafka/docs/connect-cluster/create-connect-cluster#worker-subnet * for more information. */ 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, }; } /** * Context represents an independent schema grouping in a schema registry * instance. */ export interface Context { /** * Identifier. The name of the context. Structured like: * `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}` * The context name {context} can contain the following: * Up to 255 * characters. * Allowed characters: letters (uppercase or lowercase), * numbers, and the following special characters: `.`, `-`, `_`, `+`, `%`, and * `~`. */ name?: string; /** * Optional. The subjects of the context. */ subjects?: string[]; } /** * Request to create a schema registry instance. */ export interface CreateSchemaRegistryRequest { /** * Required. The schema registry instance to create. The name field is * ignored. */ schemaRegistry?: SchemaRegistry; /** * Required. The schema registry instance ID to use for this schema registry. * The ID must contain only letters (a-z, A-Z), numbers (0-9), and underscores * (-). The maximum length is 63 characters. The ID must not start with a * number. */ schemaRegistryId?: string; } /** * Request for CreateVersion. */ export interface CreateVersionRequest { /** * Optional. The schema ID of the schema. If not specified, the schema ID * will be generated by the server. If the schema ID is specified, it must not * be used by an existing schema that is different from the schema to be * created. */ id?: number; /** * Optional. If true, the schema will be normalized before being stored. The * default is false. */ normalize?: boolean; /** * Optional. The schema references used by the schema. */ references?: SchemaReference[]; /** * Required. The schema payload */ schema?: string; /** * Optional. The type of the schema. It is optional. If not specified, the * schema type will be AVRO. */ schemaType?: | "SCHEMA_TYPE_UNSPECIFIED" | "AVRO" | "JSON" | "PROTOBUF"; /** * Optional. The version to create. It is optional. If not specified, the * version will be created with the max version ID of the subject increased by * 1. If the version ID is specified, it will be used as the new version ID * and must not be used by an existing version of the subject. */ version?: number; } /** * Response for CreateVersion. */ export interface CreateVersionResponse { /** * The unique identifier of the schema created. */ id?: number; } /** * 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; } /** * Message that represents an arbitrary HTTP body. It should only be used for * payload formats that can't be represented as JSON, such as raw binary or an * HTML page. This message can be used both in streaming and non-streaming API * methods in the request as well as the response. It can be used as a top-level * request field, which is convenient if one wants to extract parameters from * either the URL or HTTP template into the request fields and also want access * to the raw HTTP body. Example: message GetResourceRequest { // A unique * request id. string request_id = 1; // The raw HTTP body is bound to this * field. google.api.HttpBody http_body = 2; } service ResourceService { rpc * GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc * UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } * Example with streaming methods: service CaldavService { rpc * GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); * rpc UpdateCalendar(stream google.api.HttpBody) returns (stream * google.api.HttpBody); } Use of this type only changes how the request and * response bodies are handled, all other features will continue to work * unchanged. */ export interface HttpBody { /** * The HTTP Content-Type header value specifying the content type of the * body. */ contentType?: string; /** * The HTTP request/response body as raw binary. */ data?: Uint8Array; /** * Application specific response metadata. Must be set in the first response * for streaming APIs. */ extensions?: { [key: string]: any }[]; } function serializeHttpBody(data: any): HttpBody { return { ...data, data: data["data"] !== undefined ? encodeBase64(data["data"]) : undefined, }; } function deserializeHttpBody(data: any): HttpBody { return { ...data, data: data["data"] !== undefined ? decodeBase64(data["data"] as string) : undefined, }; } /** * 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[]; /** * Unordered list. Unreachable resources. Populated when the request sets * `ListOperationsRequest.return_partial_success` and reads across * collections. For example, when attempting to list all resources across all * supported locations. */ unreachable?: string[]; } /** * Request for ListSchemaRegistries. */ export interface ListSchemaRegistriesResponse { /** * The schema registry instances. */ schemaRegistries?: SchemaRegistry[]; } /** * 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; } /** * Request for LookupVersion. */ export interface LookupVersionRequest { /** * Optional. If true, soft-deleted versions will be included in lookup, no * matter if the subject is active or soft-deleted. If false, soft-deleted * versions will be excluded. The default is false. */ deleted?: boolean; /** * Optional. If true, the schema will be normalized before being looked up. * The default is false. */ normalize?: boolean; /** * Optional. The schema references used by the schema. */ references?: SchemaReference[]; /** * Required. The schema payload */ schema?: string; /** * Optional. The schema type of the schema. */ schemaType?: | "SCHEMA_TYPE_UNSPECIFIED" | "AVRO" | "JSON" | "PROTOBUF"; } /** * 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. Filter expression for the result. Only supports filtering by * topic name as a key in the `topics` map. */ filter?: string; /** * 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; /** * Optional. Specifies the view (BASIC or FULL) of the ConsumerGroup resource * to be returned in the response. Defaults to FULL view. */ view?: | "CONSUMER_GROUP_VIEW_UNSPECIFIED" | "CONSUMER_GROUP_VIEW_BASIC" | "CONSUMER_GROUP_VIEW_FULL"; } /** * 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#projectsLocationsClustersGet. */ export interface ProjectsLocationsClustersGetOptions { /** * Optional. Specifies the view of the Cluster resource to be returned. * Defaults to CLUSTER_VIEW_BASIC. See the ClusterView enum for possible * values. */ view?: | "CLUSTER_VIEW_UNSPECIFIED" | "CLUSTER_VIEW_BASIC" | "CLUSTER_VIEW_FULL"; } /** * 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. Do not use this field. It is unsupported and is ignored unless * explicitly documented otherwise. This is primarily for internal usage. */ extraLocationTypes?: string; /** * A filter to narrow down results to a preferred subset. The filtering * language accepts strings like `"displayName=tokyo"`, and is documented in * more detail in [AIP-160](https://google.aip.dev/160). */ filter?: string; /** * The maximum number of results to return. If not set, the service selects a * default. */ pageSize?: number; /** * A page token received from the `next_page_token` field in the response. * Send that page token to receive the subsequent page. */ pageToken?: string; } /** * Additional options for 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; /** * When set to `true`, operations that are reachable are returned as normal, * and those that are unreachable are returned in the * ListOperationsResponse.unreachable field. This can only be `true` when * reading across collections. For example, when `parent` is set to * `"projects/example/locations/-"`. This field is not supported by default * and will result in an `UNIMPLEMENTED` error if set unless explicitly * documented otherwise in service or product specific documentation. */ returnPartialSuccess?: boolean; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesConfigGet. */ export interface ProjectsLocationsSchemaRegistriesConfigGetOptions { /** * Optional. If true, the config will fall back to the config at the global * level if no subject level config is found. */ defaultToGlobal?: boolean; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesContextsConfigGet. */ export interface ProjectsLocationsSchemaRegistriesContextsConfigGetOptions { /** * Optional. If true, the config will fall back to the config at the global * level if no subject level config is found. */ defaultToGlobal?: boolean; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesContextsSchemasGet. */ export interface ProjectsLocationsSchemaRegistriesContextsSchemasGetOptions { /** * Optional. Used to limit the search for the schema ID to a specific * subject, otherwise the schema ID will be searched for in all subjects in * the given specified context. */ subject?: string; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesContextsSchemasGetSchema. */ export interface ProjectsLocationsSchemaRegistriesContextsSchemasGetSchemaOptions { /** * Optional. Used to limit the search for the schema ID to a specific * subject, otherwise the schema ID will be searched for in all subjects in * the given specified context. */ subject?: string; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesContextsSchemasSubjectsList. */ export interface ProjectsLocationsSchemaRegistriesContextsSchemasSubjectsListOptions { /** * Optional. If true, the response will include soft-deleted subjects. The * default is false. */ deleted?: boolean; /** * Optional. The subject to filter the subjects by. */ subject?: string; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesContextsSchemasVersionsList. */ export interface ProjectsLocationsSchemaRegistriesContextsSchemasVersionsListOptions { /** * Optional. If true, the response will include soft-deleted versions of the * schema, even if the subject is soft-deleted. The default is false. */ deleted?: boolean; /** * Optional. The subject to filter the subjects by. */ subject?: string; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesContextsSubjectsDelete. */ export interface ProjectsLocationsSchemaRegistriesContextsSubjectsDeleteOptions { /** * Optional. If true, the subject and all associated metadata including the * schema ID will be deleted permanently. Otherwise, only the subject is * soft-deleted. The default is false. Soft-deleted subjects can still be * searched in ListSubjects API call with deleted=true query parameter. A * soft-delete of a subject must be performed before a hard-delete. */ permanent?: boolean; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesContextsSubjectsList. */ export interface ProjectsLocationsSchemaRegistriesContextsSubjectsListOptions { /** * Optional. If true, the response will include soft-deleted subjects. The * default is false. */ deleted?: boolean; /** * Optional. The context to filter the subjects by, in the format of * `:.{context}:`. If unset, all subjects in the registry are returned. Set to * empty string or add as '?subjectPrefix=' at the end of this request to list * subjects in the default context. */ subjectPrefix?: string; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesContextsSubjectsVersionsDelete. */ export interface ProjectsLocationsSchemaRegistriesContextsSubjectsVersionsDeleteOptions { /** * Optional. If true, both the version and the referenced schema ID will be * permanently deleted. The default is false. If false, the version will be * deleted but the schema ID will be retained. Soft-deleted versions can still * be searched in ListVersions API call with deleted=true query parameter. A * soft-delete of a version must be performed before a hard-delete. */ permanent?: boolean; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesContextsSubjectsVersionsGet. */ export interface ProjectsLocationsSchemaRegistriesContextsSubjectsVersionsGetOptions { /** * Optional. If true, no matter if the subject/version is soft-deleted or * not, it returns the version details. If false, it returns NOT_FOUND error * if the subject/version is soft-deleted. The default is false. */ deleted?: boolean; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesContextsSubjectsVersionsGetSchema. */ export interface ProjectsLocationsSchemaRegistriesContextsSubjectsVersionsGetSchemaOptions { /** * Optional. If true, no matter if the subject/version is soft-deleted or * not, it returns the version details. If false, it returns NOT_FOUND error * if the subject/version is soft-deleted. The default is false. */ deleted?: boolean; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesContextsSubjectsVersionsList. */ export interface ProjectsLocationsSchemaRegistriesContextsSubjectsVersionsListOptions { /** * Optional. If true, the response will include soft-deleted versions of an * active or soft-deleted subject. The default is false. */ deleted?: boolean; } /** * Additional options for ManagedKafka#projectsLocationsSchemaRegistriesList. */ export interface ProjectsLocationsSchemaRegistriesListOptions { /** * Optional. Specifies the view to return for the schema registry instances. * If not specified, the default view is SCHEMA_REGISTRY_VIEW_BASIC. */ view?: | "SCHEMA_REGISTRY_VIEW_UNSPECIFIED" | "SCHEMA_REGISTRY_VIEW_BASIC" | "SCHEMA_REGISTRY_VIEW_FULL"; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesSchemasGet. */ export interface ProjectsLocationsSchemaRegistriesSchemasGetOptions { /** * Optional. Used to limit the search for the schema ID to a specific * subject, otherwise the schema ID will be searched for in all subjects in * the given specified context. */ subject?: string; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesSchemasGetSchema. */ export interface ProjectsLocationsSchemaRegistriesSchemasGetSchemaOptions { /** * Optional. Used to limit the search for the schema ID to a specific * subject, otherwise the schema ID will be searched for in all subjects in * the given specified context. */ subject?: string; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesSchemasSubjectsList. */ export interface ProjectsLocationsSchemaRegistriesSchemasSubjectsListOptions { /** * Optional. If true, the response will include soft-deleted subjects. The * default is false. */ deleted?: boolean; /** * Optional. The subject to filter the subjects by. */ subject?: string; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesSchemasVersionsList. */ export interface ProjectsLocationsSchemaRegistriesSchemasVersionsListOptions { /** * Optional. If true, the response will include soft-deleted versions of the * schema, even if the subject is soft-deleted. The default is false. */ deleted?: boolean; /** * Optional. The subject to filter the subjects by. */ subject?: string; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesSubjectsDelete. */ export interface ProjectsLocationsSchemaRegistriesSubjectsDeleteOptions { /** * Optional. If true, the subject and all associated metadata including the * schema ID will be deleted permanently. Otherwise, only the subject is * soft-deleted. The default is false. Soft-deleted subjects can still be * searched in ListSubjects API call with deleted=true query parameter. A * soft-delete of a subject must be performed before a hard-delete. */ permanent?: boolean; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesSubjectsList. */ export interface ProjectsLocationsSchemaRegistriesSubjectsListOptions { /** * Optional. If true, the response will include soft-deleted subjects. The * default is false. */ deleted?: boolean; /** * Optional. The context to filter the subjects by, in the format of * `:.{context}:`. If unset, all subjects in the registry are returned. Set to * empty string or add as '?subjectPrefix=' at the end of this request to list * subjects in the default context. */ subjectPrefix?: string; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesSubjectsVersionsDelete. */ export interface ProjectsLocationsSchemaRegistriesSubjectsVersionsDeleteOptions { /** * Optional. If true, both the version and the referenced schema ID will be * permanently deleted. The default is false. If false, the version will be * deleted but the schema ID will be retained. Soft-deleted versions can still * be searched in ListVersions API call with deleted=true query parameter. A * soft-delete of a version must be performed before a hard-delete. */ permanent?: boolean; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesSubjectsVersionsGet. */ export interface ProjectsLocationsSchemaRegistriesSubjectsVersionsGetOptions { /** * Optional. If true, no matter if the subject/version is soft-deleted or * not, it returns the version details. If false, it returns NOT_FOUND error * if the subject/version is soft-deleted. The default is false. */ deleted?: boolean; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesSubjectsVersionsGetSchema. */ export interface ProjectsLocationsSchemaRegistriesSubjectsVersionsGetSchemaOptions { /** * Optional. If true, no matter if the subject/version is soft-deleted or * not, it returns the version details. If false, it returns NOT_FOUND error * if the subject/version is soft-deleted. The default is false. */ deleted?: boolean; } /** * Additional options for * ManagedKafka#projectsLocationsSchemaRegistriesSubjectsVersionsList. */ export interface ProjectsLocationsSchemaRegistriesSubjectsVersionsListOptions { /** * Optional. If true, the response will include soft-deleted versions of an * active or soft-deleted subject. The default is false. */ deleted?: boolean; } /** * 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 { } /** * Schema for a Kafka message. */ export interface Schema { /** * Optional. The schema references used by the schema. */ references?: SchemaReference[]; /** * The schema payload. */ schema?: string; /** * Optional. The schema type of the schema. */ schemaType?: | "SCHEMA_TYPE_UNSPECIFIED" | "AVRO" | "JSON" | "PROTOBUF"; } /** * SchemaConfig represents configuration for a schema registry or a specific * subject. */ export interface SchemaConfig { /** * Optional. The subject to which this subject is an alias of. Only * applicable for subject config. */ alias?: string; /** * Required. The compatibility type of the schema. The default value is * BACKWARD. If unset in a SchemaSubject-level SchemaConfig, defaults to the * global value. If unset in a SchemaRegistry-level SchemaConfig, reverts to * the default value. */ compatibility?: | "NONE" | "BACKWARD" | "BACKWARD_TRANSITIVE" | "FORWARD" | "FORWARD_TRANSITIVE" | "FULL" | "FULL_TRANSITIVE"; /** * Optional. If true, the schema will be normalized before being stored or * looked up. The default is false. If unset in a SchemaSubject-level * SchemaConfig, the global value will be used. If unset in a * SchemaRegistry-level SchemaConfig, reverts to the default value. */ normalize?: boolean; } /** * SchemaMode represents the mode of a schema registry or a specific subject. * Four modes are supported: * NONE: deprecated. This was the default mode for a * subject, but now the default is unset (which means use the global schema * registry setting) * READONLY: The schema registry is in read-only mode. * * READWRITE: The schema registry is in read-write mode, which allows limited * write operations on the schema. * IMPORT: The schema registry is in import * mode, which allows more editing operations on the schema for data importing * purposes. */ export interface SchemaMode { /** * Required. The mode type of a schema registry (READWRITE by default) or of * a subject (unset by default, which means use the global schema registry * setting). */ mode?: | "NONE" | "READONLY" | "READWRITE" | "IMPORT"; } /** * SchemaReference is a reference to a schema. */ export interface SchemaReference { /** * Required. The name of the reference. */ name?: string; /** * Required. The subject of the reference. */ subject?: string; /** * Required. The version of the reference. */ version?: number; } /** * SchemaRegistry is a schema registry instance. */ export interface SchemaRegistry { /** * Output only. The contexts of the schema registry instance. */ readonly contexts?: string[]; /** * Identifier. The name of the schema registry instance. Structured like: * `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}` * The instance name {schema_registry} can contain the following: * Up to 255 * characters. * Letters (uppercase or lowercase), numbers, and underscores. */ name?: string; } /** * Version of a schema. */ export interface SchemaVersion { /** * Required. The schema ID. */ id?: number; /** * Optional. The schema references used by the schema. */ references?: SchemaReference[]; /** * Required. The schema payload. */ schema?: string; /** * Optional. The schema type of the schema. */ schemaType?: | "SCHEMA_TYPE_UNSPECIFIED" | "AVRO" | "JSON" | "PROTOBUF"; /** * Required. The subject of the version. */ subject?: string; /** * Required. The version ID */ version?: number; } /** * 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. The default policy * retries tasks with a minimum_backoff of 60 seconds, and a maximum_backoff of * 12 hours. You can disable the policy by setting the task_retry_disabled field * to true. 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 12 hours * 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 */; /** * Optional. If true, task retry is disabled. */ taskRetryDisabled?: boolean; } 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, }; } /** * The TLS configuration for the Kafka cluster. */ export interface TlsConfig { /** * Optional. A list of rules for mapping from SSL principal names to short * names. These are applied in order by Kafka. Refer to the Apache Kafka * documentation for `ssl.principal.mapping.rules` for the precise formatting * details and syntax. Example: * "RULE:^CN=(.*?),OU=ServiceUsers.*$/$1@example.com/,DEFAULT" This is a * static Kafka broker configuration. Setting or modifying this field will * trigger a rolling restart of the Kafka brokers to apply the change. An * empty string means no rules are applied (Kafka default). */ sslPrincipalMappingRules?: string; /** * Optional. The configuration of the broker truststore. If specified, * clients can use mTLS for authentication. */ trustConfig?: TrustConfig; } /** * 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; } /** * Sources of CA certificates to install in the broker's truststore. */ export interface TrustConfig { /** * Optional. Configuration for the Google Certificate Authority Service. * Maximum 10. */ casConfigs?: CertificateAuthorityServiceConfig[]; } /** * UpdateOptions specifies options that influence how a cluster update is * applied. These options control the behavior of the update process, rather * than defining the desired end-state of a cluster. */ export interface UpdateOptions { /** * Optional. If true, allows an update operation that increases the total * vCPU and/or memory allocation of the cluster to significantly decrease the * per-broker vCPU and/or memory allocation. This can result in reduced * performance and availability. By default, the update operation will fail if * an upscale request results in a vCPU or memory allocation for the brokers * that is smaller than 90% of the current broker size. */ allowBrokerDownscaleOnClusterUpscale?: boolean; } /** * Request for updating schema config. On a SchemaSubject-level SchemaConfig, * an unset field will be removed from the SchemaConfig. */ export interface UpdateSchemaConfigRequest { /** * Required. The compatibility type of the schemas. Cannot be unset for a * SchemaRegistry-level SchemaConfig. If unset on a SchemaSubject-level * SchemaConfig, removes the compatibility field for the SchemaConfig. */ compatibility?: | "NONE" | "BACKWARD" | "BACKWARD_TRANSITIVE" | "FORWARD" | "FORWARD_TRANSITIVE" | "FULL" | "FULL_TRANSITIVE"; /** * Optional. If true, the schema will be normalized before being stored or * looked up. The default is false. Cannot be unset for a SchemaRegistry-level * SchemaConfig. If unset on a SchemaSubject-level SchemaConfig, removes the * normalize field for the SchemaConfig. */ normalize?: boolean; } /** * Request for updating schema registry or subject mode. */ export interface UpdateSchemaModeRequest { /** * Required. The mode type. */ mode?: | "NONE" | "READONLY" | "READWRITE" | "IMPORT"; } function decodeBase64(b64: string): Uint8Array { const binString = atob(b64); const size = binString.length; const bytes = new Uint8Array(size); for (let i = 0; i < size; i++) { bytes[i] = binString.charCodeAt(i); } return bytes; } const base64abc = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"]; /** * CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727 * Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation * @param data */ function encodeBase64(uint8: Uint8Array): string { let result = "", i; const l = uint8.length; for (i = 2; i < l; i += 3) { result += base64abc[uint8[i - 2] >> 2]; result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; result += base64abc[((uint8[i - 1] & 0x0f) << 2) | (uint8[i] >> 6)]; result += base64abc[uint8[i] & 0x3f]; } if (i === l + 1) { // 1 octet yet to write result += base64abc[uint8[i - 2] >> 2]; result += base64abc[(uint8[i - 2] & 0x03) << 4]; result += "=="; } if (i === l) { // 2 octets yet to write result += base64abc[uint8[i - 2] >> 2]; result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; result += base64abc[(uint8[i - 1] & 0x0f) << 2]; result += "="; } return result; }