// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Analytics Hub API Client for Deno * ================================= * * Exchange data and analytics assets securely and efficiently. * * Docs: https://cloud.google.com/bigquery/docs/analytics-hub-introduction * Source: https://googleapis.deno.dev/v1/analyticshub:v1.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Exchange data and analytics assets securely and efficiently. */ export class AnalyticsHub { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://analyticshub.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Lists all data exchanges from projects in a given organization and * location. * * @param organization Required. The organization resource path of the projects containing DataExchanges. e.g. `organizations/myorg/locations/US`. */ async organizationsLocationsDataExchangesList(organization: string, opts: OrganizationsLocationsDataExchangesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ organization }/dataExchanges`); 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 deserializeListOrgDataExchangesResponse(data); } /** * Creates a new data exchange. * * @param parent Required. The parent resource path of the data exchange. e.g. `projects/myproject/locations/US`. */ async projectsLocationsDataExchangesCreate(parent: string, req: DataExchange, opts: ProjectsLocationsDataExchangesCreateOptions = {}): Promise { req = serializeDataExchange(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/dataExchanges`); if (opts.dataExchangeId !== undefined) { url.searchParams.append("dataExchangeId", String(opts.dataExchangeId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeDataExchange(data); } /** * Deletes an existing data exchange. * * @param name Required. The full name of the data exchange resource that you want to delete. For example, `projects/myproject/locations/US/dataExchanges/123`. */ async projectsLocationsDataExchangesDelete(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 details of a data exchange. * * @param name Required. The resource name of the data exchange. e.g. `projects/myproject/locations/US/dataExchanges/123`. */ async projectsLocationsDataExchangesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeDataExchange(data); } /** * Gets the IAM policy. * * @param resource REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. */ async projectsLocationsDataExchangesGetIamPolicy(resource: string, req: GetIamPolicyRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ resource }:getIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Lists all data exchanges in a given project and location. * * @param parent Required. The parent resource path of the data exchanges. e.g. `projects/myproject/locations/US`. */ async projectsLocationsDataExchangesList(parent: string, opts: ProjectsLocationsDataExchangesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/dataExchanges`); 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 deserializeListDataExchangesResponse(data); } /** * Creates a new listing. * * @param parent Required. The parent resource path of the listing. e.g. `projects/myproject/locations/US/dataExchanges/123`. */ async projectsLocationsDataExchangesListingsCreate(parent: string, req: Listing, opts: ProjectsLocationsDataExchangesListingsCreateOptions = {}): Promise { req = serializeListing(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/listings`); if (opts.listingId !== undefined) { url.searchParams.append("listingId", String(opts.listingId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeListing(data); } /** * Deletes a listing. * * @param name Required. Resource name of the listing to delete. e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. */ async projectsLocationsDataExchangesListingsDelete(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 details of a listing. * * @param name Required. The resource name of the listing. e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. */ async projectsLocationsDataExchangesListingsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListing(data); } /** * Gets the IAM policy. * * @param resource REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. */ async projectsLocationsDataExchangesListingsGetIamPolicy(resource: string, req: GetIamPolicyRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ resource }:getIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Lists all listings in a given project and location. * * @param parent Required. The parent resource path of the listing. e.g. `projects/myproject/locations/US/dataExchanges/123`. */ async projectsLocationsDataExchangesListingsList(parent: string, opts: ProjectsLocationsDataExchangesListingsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/listings`); 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 deserializeListListingsResponse(data); } /** * Lists all subscriptions on a given Data Exchange or Listing. * * @param resource Required. Resource name of the requested target. This resource may be either a Listing or a DataExchange. e.g. projects/123/locations/US/dataExchanges/456 OR e.g. projects/123/locations/US/dataExchanges/456/listings/789 */ async projectsLocationsDataExchangesListingsListSubscriptions(resource: string, opts: ProjectsLocationsDataExchangesListingsListSubscriptionsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ resource }:listSubscriptions`); if (opts.includeDeletedSubscriptions !== undefined) { url.searchParams.append("includeDeletedSubscriptions", String(opts.includeDeletedSubscriptions)); } 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 ListSharedResourceSubscriptionsResponse; } /** * Updates an existing listing. * * @param name Output only. The resource name of the listing. e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456` */ async projectsLocationsDataExchangesListingsPatch(name: string, req: Listing, opts: ProjectsLocationsDataExchangesListingsPatchOptions = {}): Promise { req = serializeListing(req); opts = serializeProjectsLocationsDataExchangesListingsPatchOptions(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 deserializeListing(data); } /** * Sets the IAM policy. * * @param resource REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. */ async projectsLocationsDataExchangesListingsSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise { req = serializeSetIamPolicyRequest(req); const url = new URL(`${this.#baseUrl}v1/${ resource }:setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Subscribes to a listing. Currently, with Analytics Hub, you can create * listings that reference only BigQuery datasets. Upon subscription to a * listing for a BigQuery dataset, Analytics Hub creates a linked dataset in * the subscriber's project. * * @param name Required. Resource name of the listing that you want to subscribe to. e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. */ async projectsLocationsDataExchangesListingsSubscribe(name: string, req: SubscribeListingRequest): Promise { req = serializeSubscribeListingRequest(req); const url = new URL(`${this.#baseUrl}v1/${ name }:subscribe`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as SubscribeListingResponse; } /** * Returns the permissions that a caller has. * * @param resource REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. */ async projectsLocationsDataExchangesListingsTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ resource }:testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestIamPermissionsResponse; } /** * Lists all subscriptions on a given Data Exchange or Listing. * * @param resource Required. Resource name of the requested target. This resource may be either a Listing or a DataExchange. e.g. projects/123/locations/US/dataExchanges/456 OR e.g. projects/123/locations/US/dataExchanges/456/listings/789 */ async projectsLocationsDataExchangesListSubscriptions(resource: string, opts: ProjectsLocationsDataExchangesListSubscriptionsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ resource }:listSubscriptions`); if (opts.includeDeletedSubscriptions !== undefined) { url.searchParams.append("includeDeletedSubscriptions", String(opts.includeDeletedSubscriptions)); } 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 ListSharedResourceSubscriptionsResponse; } /** * Updates an existing data exchange. * * @param name Output only. The resource name of the data exchange. e.g. `projects/myproject/locations/US/dataExchanges/123`. */ async projectsLocationsDataExchangesPatch(name: string, req: DataExchange, opts: ProjectsLocationsDataExchangesPatchOptions = {}): Promise { req = serializeDataExchange(req); opts = serializeProjectsLocationsDataExchangesPatchOptions(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 deserializeDataExchange(data); } /** * Sets the IAM policy. * * @param resource REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. */ async projectsLocationsDataExchangesSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise { req = serializeSetIamPolicyRequest(req); const url = new URL(`${this.#baseUrl}v1/${ resource }:setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Creates a Subscription to a Data Clean Room. This is a long-running * operation as it will create one or more linked datasets. * * @param name Required. Resource name of the Data Exchange. e.g. `projects/publisherproject/locations/US/dataExchanges/123` */ async projectsLocationsDataExchangesSubscribe(name: string, req: SubscribeDataExchangeRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:subscribe`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Returns the permissions that a caller has. * * @param resource REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. */ async projectsLocationsDataExchangesTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ resource }:testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestIamPermissionsResponse; } /** * Deletes a subscription. * * @param name Required. Resource name of the subscription to delete. e.g. projects/123/locations/US/subscriptions/456 */ async projectsLocationsSubscriptionsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets the details of a Subscription. * * @param name Required. Resource name of the subscription. e.g. projects/123/locations/US/subscriptions/456 */ async projectsLocationsSubscriptionsGet(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 Subscription; } /** * Gets the IAM policy. * * @param resource REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. */ async projectsLocationsSubscriptionsGetIamPolicy(resource: string, req: GetIamPolicyRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ resource }:getIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Lists all subscriptions in a given project and location. * * @param parent Required. The parent resource path of the subscription. e.g. projects/myproject/locations/US */ async projectsLocationsSubscriptionsList(parent: string, opts: ProjectsLocationsSubscriptionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/subscriptions`); 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 ListSubscriptionsResponse; } /** * Refreshes a Subscription to a Data Exchange. A Data Exchange can become * stale when a publisher adds or removes data. This is a long-running * operation as it may create many linked datasets. * * @param name Required. Resource name of the Subscription to refresh. e.g. `projects/subscriberproject/locations/US/subscriptions/123` */ async projectsLocationsSubscriptionsRefresh(name: string, req: RefreshSubscriptionRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:refresh`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Revokes a given subscription. * * @param name Required. Resource name of the subscription to revoke. e.g. projects/123/locations/US/subscriptions/456 */ async projectsLocationsSubscriptionsRevoke(name: string, req: RevokeSubscriptionRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:revoke`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as RevokeSubscriptionResponse; } /** * Sets the IAM policy. * * @param resource REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. */ async projectsLocationsSubscriptionsSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise { req = serializeSetIamPolicyRequest(req); const url = new URL(`${this.#baseUrl}v1/${ resource }:setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } } /** * Information about an associated Analytics Hub subscription * (https://cloud.google.com/bigquery/docs/analytics-hub-manage-subscriptions). */ export interface AnalyticsHubSubscriptionInfo { /** * Optional. The name of the associated Analytics Hub listing resource. * Pattern: * "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" */ listing?: string; /** * Optional. The name of the associated Analytics Hub subscription resource. * Pattern: * "projects/{project}/locations/{location}/subscriptions/{subscription}" */ subscription?: string; } /** * Specifies the audit configuration for a service. The configuration * determines which permission types are logged, and what identities, if any, * are exempted from logging. An AuditConfig must have one or more * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a * specific service, the union of the two AuditConfigs is used for that service: * the log_types specified in each AuditConfig are enabled, and the * exempted_members in each AuditLogConfig are exempted. Example Policy with * multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", * "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ * "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": * "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", * "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": * "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For * sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ * logging. It also exempts `jose@example.com` from DATA_READ logging, and * `aliya@example.com` from DATA_WRITE logging. */ export interface AuditConfig { /** * The configuration for logging of each type of permission. */ auditLogConfigs?: AuditLogConfig[]; /** * Specifies a service that will be enabled for audit logging. For example, * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a * special value that covers all services. */ service?: string; } /** * Provides the configuration for logging a type of permissions. Example: { * "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ * "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" } ] } This enables * 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from * DATA_READ logging. */ export interface AuditLogConfig { /** * Specifies the identities that do not cause logging for this type of * permission. Follows the same format of Binding.members. */ exemptedMembers?: string[]; /** * The log type that this config enables. */ logType?: | "LOG_TYPE_UNSPECIFIED" | "ADMIN_READ" | "DATA_WRITE" | "DATA_READ"; } /** * Configuration for writing message data in Avro format. Message payloads and * metadata will be written to files as an Avro binary. */ export interface AvroConfig { /** * Optional. When true, the output Cloud Storage file will be serialized * using the topic schema, if it exists. */ useTopicSchema?: boolean; /** * Optional. When true, write the subscription name, message_id, * publish_time, attributes, and ordering_key as additional fields in the * output. The subscription name, message_id, and publish_time fields are put * in their own fields while all other message properties other than data (for * example, an ordering_key, if present) are added as entries in the * attributes map. */ writeMetadata?: boolean; } /** * Configuration for a BigQuery subscription. */ export interface BigQueryConfig { /** * Optional. When true and use_topic_schema is true, any fields that are a * part of the topic schema that are not part of the BigQuery table schema are * dropped when writing to BigQuery. Otherwise, the schemas must be kept in * sync and any messages with extra fields are not written and remain in the * subscription's backlog. */ dropUnknownFields?: boolean; /** * Optional. The service account to use to write to BigQuery. The * subscription creator or updater that specifies this field must have * `iam.serviceAccounts.actAs` permission on the service account. If not * specified, the Pub/Sub [service * agent](https://cloud.google.com/iam/docs/service-agents), * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. */ serviceAccountEmail?: string; /** * Output only. An output-only field that indicates whether or not the * subscription can receive messages. */ readonly state?: | "STATE_UNSPECIFIED" | "ACTIVE" | "PERMISSION_DENIED" | "NOT_FOUND" | "SCHEMA_MISMATCH" | "IN_TRANSIT_LOCATION_RESTRICTION"; /** * Optional. The name of the table to which to write data, of the form * {projectId}.{datasetId}.{tableId} */ table?: string; /** * Optional. When true, use the BigQuery table's schema as the columns to * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be * enabled at the same time. */ useTableSchema?: boolean; /** * Optional. When true, use the topic's schema as the columns to write to in * BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be * enabled at the same time. */ useTopicSchema?: boolean; /** * Optional. When true, write the subscription name, message_id, * publish_time, attributes, and ordering_key to additional columns in the * table. The subscription name, message_id, and publish_time fields are put * in their own columns while all other message properties (other than data) * are written to a JSON object in the attributes column. */ writeMetadata?: boolean; } /** * A reference to a shared dataset. It is an existing BigQuery dataset with a * collection of objects such as tables and views that you want to share with * subscribers. When subscriber's subscribe to a listing, Analytics Hub creates * a linked dataset in the subscriber's project. A Linked dataset is an opaque, * read-only BigQuery dataset that serves as a _symbolic link_ to a shared * dataset. */ export interface BigQueryDatasetSource { /** * Resource name of the dataset source for this listing. e.g. * `projects/myproject/datasets/123` */ dataset?: string; /** * Optional. If set, restricted export policy will be propagated and enforced * on the linked dataset. */ restrictedExportPolicy?: RestrictedExportPolicy; /** * Optional. Resource in this dataset that is selectively shared. This field * is required for data clean room exchanges. */ selectedResources?: SelectedResource[]; } /** * Associates `members`, or principals, with a `role`. */ export interface Binding { /** * The condition that is associated with this binding. If the condition * evaluates to `true`, then this binding applies to the current request. If * the condition evaluates to `false`, then this binding does not apply to the * current request. However, a different role binding might grant the same * role to one or more of the principals in this binding. To learn which * resources support conditions in their IAM policies, see the [IAM * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). */ condition?: Expr; /** * Specifies the principals requesting access for a Google Cloud resource. * `members` can have the following values: * `allUsers`: A special identifier * that represents anyone who is on the internet; with or without a Google * account. * `allAuthenticatedUsers`: A special identifier that represents * anyone who is authenticated with a Google account or a service account. * Does not include identities that come from external identity providers * (IdPs) through identity federation. * `user:{emailid}`: An email address * that represents a specific Google account. For example, `alice@example.com` * . * `serviceAccount:{emailid}`: An email address that represents a Google * service account. For example, `my-other-app@appspot.gserviceaccount.com`. * * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An * identifier for a [Kubernetes service * account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). * For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * * `group:{emailid}`: An email address that represents a Google group. For * example, `admins@example.com`. * `domain:{domain}`: The G Suite domain * (primary) that represents all the users of that domain. For example, * `google.com` or `example.com`. * * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: * A single identity in a workforce identity pool. * * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: * All workforce identities in a group. * * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: * All workforce identities with a specific attribute value. * * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: * All identities in a workforce identity pool. * * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: * A single identity in a workload identity pool. * * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: * A workload identity pool group. * * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: * All identities in a workload identity pool with a certain attribute. * * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: * All identities in a workload identity pool. * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique * identifier) representing a user that has been recently deleted. For * example, `alice@example.com?uid=123456789012345678901`. If the user is * recovered, this value reverts to `user:{emailid}` and the recovered user * retains the role in the binding. * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus * unique identifier) representing a service account that has been recently * deleted. For example, * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If * the service account is undeleted, this value reverts to * `serviceAccount:{emailid}` and the undeleted service account retains the * role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email * address (plus unique identifier) representing a Google group that has been * recently deleted. For example, * `admins@example.com?uid=123456789012345678901`. If the group is recovered, * this value reverts to `group:{emailid}` and the recovered group retains the * role in the binding. * * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: * Deleted single identity in a workforce identity pool. For example, * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`. */ members?: string[]; /** * Role that is assigned to the list of `members`, or principals. For * example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview * of the IAM roles and permissions, see the [IAM * documentation](https://cloud.google.com/iam/docs/roles-overview). For a * list of the available pre-defined roles, see * [here](https://cloud.google.com/iam/docs/understanding-roles). */ role?: string; } /** * Configuration for a Cloud Storage subscription. */ export interface CloudStorageConfig { /** * Optional. If set, message data will be written to Cloud Storage in Avro * format. */ avroConfig?: AvroConfig; /** * Required. User-provided name for the Cloud Storage bucket. The bucket must * be created by the user. The bucket name must be without any prefix like * "gs://". See the [bucket naming requirements] * (https://cloud.google.com/storage/docs/buckets#naming). */ bucket?: string; /** * Optional. User-provided format string specifying how to represent * datetimes in Cloud Storage filenames. See the [datetime format * guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names). */ filenameDatetimeFormat?: string; /** * Optional. User-provided prefix for Cloud Storage filename. See the [object * naming requirements](https://cloud.google.com/storage/docs/objects#naming). */ filenamePrefix?: string; /** * Optional. User-provided suffix for Cloud Storage filename. See the [object * naming requirements](https://cloud.google.com/storage/docs/objects#naming). * Must not end in "/". */ filenameSuffix?: string; /** * Optional. The maximum bytes that can be written to a Cloud Storage file * before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may * be exceeded in cases where messages are larger than the limit. */ maxBytes?: bigint; /** * Optional. The maximum duration that can elapse before a new Cloud Storage * file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not * exceed the subscription's acknowledgement deadline. */ maxDuration?: number /* Duration */; /** * Optional. The maximum number of messages that can be written to a Cloud * Storage file before a new file is created. Min 1000 messages. */ maxMessages?: bigint; /** * Optional. The service account to use to write to Cloud Storage. The * subscription creator or updater that specifies this field must have * `iam.serviceAccounts.actAs` permission on the service account. If not * specified, the Pub/Sub [service * agent](https://cloud.google.com/iam/docs/service-agents), * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. */ serviceAccountEmail?: string; /** * Output only. An output-only field that indicates whether or not the * subscription can receive messages. */ readonly state?: | "STATE_UNSPECIFIED" | "ACTIVE" | "PERMISSION_DENIED" | "NOT_FOUND" | "IN_TRANSIT_LOCATION_RESTRICTION" | "SCHEMA_MISMATCH"; /** * Optional. If set, message data will be written to Cloud Storage in text * format. */ textConfig?: TextConfig; } function serializeCloudStorageConfig(data: any): CloudStorageConfig { return { ...data, maxBytes: data["maxBytes"] !== undefined ? String(data["maxBytes"]) : undefined, maxDuration: data["maxDuration"] !== undefined ? data["maxDuration"] : undefined, maxMessages: data["maxMessages"] !== undefined ? String(data["maxMessages"]) : undefined, }; } function deserializeCloudStorageConfig(data: any): CloudStorageConfig { return { ...data, maxBytes: data["maxBytes"] !== undefined ? BigInt(data["maxBytes"]) : undefined, maxDuration: data["maxDuration"] !== undefined ? data["maxDuration"] : undefined, maxMessages: data["maxMessages"] !== undefined ? BigInt(data["maxMessages"]) : undefined, }; } /** * A data exchange is a container that lets you share data. Along with the * descriptive information about the data exchange, it contains listings that * reference shared datasets. */ export interface DataExchange { /** * Optional. Description of the data exchange. The description must not * contain Unicode non-characters as well as C0 and C1 control codes except * tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF). * Default value is an empty string. Max length: 2000 bytes. */ description?: string; /** * Optional. Type of discovery on the discovery page for all the listings * under this exchange. Updating this field also updates (overwrites) the * discovery_type field for all the listings under this exchange. */ discoveryType?: | "DISCOVERY_TYPE_UNSPECIFIED" | "DISCOVERY_TYPE_PRIVATE" | "DISCOVERY_TYPE_PUBLIC"; /** * Required. Human-readable display name of the data exchange. The display * name must contain only Unicode letters, numbers (0-9), underscores (_), * dashes (-), spaces ( ), ampersands (&) and must not start or end with * spaces. Default value is an empty string. Max length: 63 bytes. */ displayName?: string; /** * Optional. Documentation describing the data exchange. */ documentation?: string; /** * Optional. Base64 encoded image representing the data exchange. Max Size: * 3.0MiB Expected image dimensions are 512x512 pixels, however the API only * performs validation on size of the encoded data. Note: For byte fields, the * content of the fields are base64-encoded (which increases the size of the * data by 33-36%) when using JSON on the wire. */ icon?: Uint8Array; /** * Output only. Number of listings contained in the data exchange. */ readonly listingCount?: number; /** * Output only. The resource name of the data exchange. e.g. * `projects/myproject/locations/US/dataExchanges/123`. */ readonly name?: string; /** * Optional. Email or URL of the primary point of contact of the data * exchange. Max Length: 1000 bytes. */ primaryContact?: string; /** * Optional. Configurable data sharing environment option for a data * exchange. */ sharingEnvironmentConfig?: SharingEnvironmentConfig; } function serializeDataExchange(data: any): DataExchange { return { ...data, icon: data["icon"] !== undefined ? encodeBase64(data["icon"]) : undefined, }; } function deserializeDataExchange(data: any): DataExchange { return { ...data, icon: data["icon"] !== undefined ? decodeBase64(data["icon"] as string) : undefined, }; } /** * Contains details of the data provider. */ export interface DataProvider { /** * Optional. Name of the data provider. */ name?: string; /** * Optional. Email or URL of the data provider. Max Length: 1000 bytes. */ primaryContact?: string; } /** * Data Clean Room (DCR), used for privacy-safe and secured data sharing. */ export interface DcrExchangeConfig { /** * Output only. If True, when subscribing to this DCR, it will create only * one linked dataset containing all resources shared within the cleanroom. If * False, when subscribing to this DCR, it will create 1 linked dataset per * listing. This is not configurable, and by default, all new DCRs will have * the restriction set to True. */ readonly singleLinkedDatasetPerCleanroom?: boolean; /** * Output only. If True, this DCR restricts the contributors to sharing only * a single resource in a Listing. And no two resources should have the same * IDs. So if a contributor adds a view with a conflicting name, the * CreateListing API will reject the request. if False, the data contributor * can publish an entire dataset (as before). This is not configurable, and by * default, all new DCRs will have the restriction set to True. */ readonly singleSelectedResourceSharingRestriction?: boolean; } /** * Dead lettering is done on a best effort basis. The same message might be * dead lettered multiple times. If validation on any of the fields fails at * subscription creation/updation, the create/update subscription request will * fail. */ export interface DeadLetterPolicy { /** * Optional. The name of the topic to which dead letter messages should be * published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub * service account associated with the enclosing subscription's parent project * (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must * have permission to Publish() to this topic. The operation will fail if the * topic does not exist. Users should ensure that there is a subscription * attached to this topic since messages published to a topic with no * subscriptions are lost. */ deadLetterTopic?: string; /** * Optional. The maximum number of delivery attempts for any message. The * value must be between 5 and 100. The number of delivery attempts is defined * as 1 + (the sum of number of NACKs and number of times the acknowledgement * deadline has been exceeded for the message). A NACK is any call to * ModifyAckDeadline with a 0 deadline. Note that client libraries may * automatically extend ack_deadlines. This field will be honored on a best * effort basis. If this parameter is 0, a default value of 5 is used. */ maxDeliveryAttempts?: number; } /** * Default Analytics Hub data exchange, used for secured data sharing. */ export interface DefaultExchangeConfig { } /** * Defines the destination bigquery dataset. */ export interface DestinationDataset { /** * Required. A reference that identifies the destination dataset. */ datasetReference?: DestinationDatasetReference; /** * Optional. A user-friendly description of the dataset. */ description?: string; /** * Optional. A descriptive name for the dataset. */ friendlyName?: string; /** * Optional. The labels associated with this dataset. You can use these to * organize and group your datasets. You can set this property when inserting * or updating a dataset. See * https://cloud.google.com/resource-manager/docs/creating-managing-labels for * more information. */ labels?: { [key: string]: string }; /** * Required. The geographic location where the dataset should reside. See * https://cloud.google.com/bigquery/docs/locations for supported locations. */ location?: string; } /** * Contains the reference that identifies a destination bigquery dataset. */ export interface DestinationDatasetReference { /** * Required. A unique ID for this dataset, without the project name. The ID * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). * The maximum length is 1,024 characters. */ datasetId?: string; /** * Required. The ID of the project containing this dataset. */ projectId?: string; } /** * Defines the destination Pub/Sub subscription. */ export interface DestinationPubSubSubscription { /** * Required. Destination Pub/Sub subscription resource. */ pubsubSubscription?: GooglePubsubV1Subscription; } function serializeDestinationPubSubSubscription(data: any): DestinationPubSubSubscription { return { ...data, pubsubSubscription: data["pubsubSubscription"] !== undefined ? serializeGooglePubsubV1Subscription(data["pubsubSubscription"]) : undefined, }; } function deserializeDestinationPubSubSubscription(data: any): DestinationPubSubSubscription { return { ...data, pubsubSubscription: data["pubsubSubscription"] !== undefined ? deserializeGooglePubsubV1Subscription(data["pubsubSubscription"]) : undefined, }; } /** * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request or * the response type of an API method. For instance: service Foo { rpc * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } */ export interface Empty { } /** * A policy that specifies the conditions for resource expiration (i.e., * automatic resource deletion). */ export interface ExpirationPolicy { /** * Optional. Specifies the "time-to-live" duration for an associated * resource. The resource expires if it is not active for a period of `ttl`. * The definition of "activity" depends on the type of the associated * resource. The minimum and maximum allowed values for `ttl` depend on the * type of the associated resource, as well. If `ttl` is not set, the * associated resource never expires. */ ttl?: number /* Duration */; } function serializeExpirationPolicy(data: any): ExpirationPolicy { return { ...data, ttl: data["ttl"] !== undefined ? data["ttl"] : undefined, }; } function deserializeExpirationPolicy(data: any): ExpirationPolicy { return { ...data, ttl: data["ttl"] !== undefined ? data["ttl"] : undefined, }; } /** * Represents a textual expression in the Common Expression Language (CEL) * syntax. CEL is a C-like expression language. The syntax and semantics of CEL * are documented at https://github.com/google/cel-spec. Example (Comparison): * title: "Summary size limit" description: "Determines if a summary is less * than 100 chars" expression: "document.summary.size() < 100" Example * (Equality): title: "Requestor is owner" description: "Determines if requestor * is the document owner" expression: "document.owner == * request.auth.claims.email" Example (Logic): title: "Public documents" * description: "Determine whether the document should be publicly visible" * expression: "document.type != 'private' && document.type != 'internal'" * Example (Data Manipulation): title: "Notification string" description: * "Create a notification string with a timestamp." expression: "'New message * received at ' + string(document.create_time)" The exact variables and * functions that may be referenced within an expression are determined by the * service that evaluates it. See the service documentation for additional * information. */ export interface Expr { /** * Optional. Description of the expression. This is a longer text which * describes the expression, e.g. when hovered over it in a UI. */ description?: string; /** * Textual representation of an expression in Common Expression Language * syntax. */ expression?: string; /** * Optional. String indicating the location of the expression for error * reporting, e.g. a file name and a position in the file. */ location?: string; /** * Optional. Title for the expression, i.e. a short string describing its * purpose. This can be used e.g. in UIs which allow to enter the expression. */ title?: string; } /** * Request message for `GetIamPolicy` method. */ export interface GetIamPolicyRequest { /** * OPTIONAL: A `GetPolicyOptions` object for specifying options to * `GetIamPolicy`. */ options?: GetPolicyOptions; } /** * Encapsulates settings provided to GetIamPolicy. */ export interface GetPolicyOptions { /** * Optional. The maximum policy version that will be used to format the * policy. Valid values are 0, 1, and 3. Requests specifying an invalid value * will be rejected. Requests for policies with any conditional role bindings * must specify version 3. Policies with no conditional role bindings may * specify any valid value or leave the field unset. The policy in the * response might use the policy version that you specified, or it might use a * lower policy version. For example, if you specify version 3, but the policy * has no conditional role bindings, the response uses version 1. To learn * which resources support conditions in their IAM policies, see the [IAM * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). */ requestedPolicyVersion?: number; } /** * A subscription resource. If none of `push_config`, `bigquery_config`, or * `cloud_storage_config` is set, then the subscriber will pull and ack messages * using API methods. At most one of these fields may be set. */ export interface GooglePubsubV1Subscription { /** * Optional. The approximate amount of time (on a best-effort basis) Pub/Sub * waits for the subscriber to acknowledge receipt before resending the * message. In the interval after the message is delivered and before it is * acknowledged, it is considered to be _outstanding_. During that time * period, the message will not be redelivered (on a best-effort basis). For * pull subscriptions, this value is used as the initial value for the ack * deadline. To override this value for a given message, call * `ModifyAckDeadline` with the corresponding `ack_id` if using non-streaming * pull or send the `ack_id` in a `StreamingModifyAckDeadlineRequest` if using * streaming pull. The minimum custom deadline you can specify is 10 seconds. * The maximum custom deadline you can specify is 600 seconds (10 minutes). If * this parameter is 0, a default value of 10 seconds is used. For push * delivery, this value is also used to set the request timeout for the call * to the push endpoint. If the subscriber never acknowledges the message, the * Pub/Sub system will eventually redeliver the message. */ ackDeadlineSeconds?: number; /** * Output only. Information about the associated Analytics Hub subscription. * Only set if the subscritpion is created by Analytics Hub. */ readonly analyticsHubSubscriptionInfo?: AnalyticsHubSubscriptionInfo; /** * Optional. If delivery to BigQuery is used with this subscription, this * field is used to configure it. */ bigqueryConfig?: BigQueryConfig; /** * Optional. If delivery to Google Cloud Storage is used with this * subscription, this field is used to configure it. */ cloudStorageConfig?: CloudStorageConfig; /** * Optional. A policy that specifies the conditions for dead lettering * messages in this subscription. If dead_letter_policy is not set, dead * lettering is disabled. The Pub/Sub service account associated with this * subscriptions's parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. */ deadLetterPolicy?: DeadLetterPolicy; /** * Optional. Indicates whether the subscription is detached from its topic. * Detached subscriptions don't receive messages from their topic and don't * retain any backlog. `Pull` and `StreamingPull` requests will return * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to * the endpoint will not be made. */ detached?: boolean; /** * Optional. If true, Pub/Sub provides the following guarantees for the * delivery of a message with a given value of `message_id` on this * subscription: * The message sent to a subscriber is guaranteed not to be * resent before the message's acknowledgement deadline expires. * An * acknowledged message will not be resent to a subscriber. Note that * subscribers may still receive multiple copies of a message when * `enable_exactly_once_delivery` is true if the message was published * multiple times by a publisher client. These copies are considered distinct * by Pub/Sub and have distinct `message_id` values. */ enableExactlyOnceDelivery?: boolean; /** * Optional. If true, messages published with the same `ordering_key` in * `PubsubMessage` will be delivered to the subscribers in the order in which * they are received by the Pub/Sub system. Otherwise, they may be delivered * in any order. */ enableMessageOrdering?: boolean; /** * Optional. A policy that specifies the conditions for this subscription's * expiration. A subscription is considered active as long as any connected * subscriber is successfully consuming messages from the subscription or is * issuing operations on the subscription. If `expiration_policy` is not set, * a *default policy* with `ttl` of 31 days will be used. The minimum allowed * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, * but `expiration_policy.ttl` is not set, the subscription never expires. */ expirationPolicy?: ExpirationPolicy; /** * Optional. An expression written in the Pub/Sub [filter * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, * then only `PubsubMessage`s whose `attributes` field matches the filter are * delivered on this subscription. If empty, then no messages are filtered * out. */ filter?: string; /** * Optional. See [Creating and managing * labels](https://cloud.google.com/pubsub/docs/labels). */ labels?: { [key: string]: string }; /** * Optional. How long to retain unacknowledged messages in the subscription's * backlog, from the moment a message is published. If `retain_acked_messages` * is true, then this also configures the retention of acknowledged messages, * and thus configures how far back in time a `Seek` can be done. Defaults to * 7 days. Cannot be more than 31 days or less than 10 minutes. */ messageRetentionDuration?: number /* Duration */; /** * Required. Name of the subscription. Format is * `projects/{project}/subscriptions/{sub}`. */ name?: string; /** * Optional. If push delivery is used with this subscription, this field is * used to configure it. */ pushConfig?: PushConfig; /** * Optional. Indicates whether to retain acknowledged messages. If true, then * messages are not expunged from the subscription's backlog, even if they are * acknowledged, until they fall out of the `message_retention_duration` * window. This must be true if you would like to [`Seek` to a timestamp] * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in * the past to replay previously-acknowledged messages. */ retainAckedMessages?: boolean; /** * Optional. A policy that specifies how Pub/Sub retries message delivery for * this subscription. If not set, the default retry policy is applied. This * generally implies that messages will be retried as soon as possible for * healthy subscribers. RetryPolicy will be triggered on NACKs or * acknowledgement deadline exceeded events for a given message. */ retryPolicy?: RetryPolicy; /** * Output only. An output-only field indicating whether or not the * subscription can receive messages. */ readonly state?: | "STATE_UNSPECIFIED" | "ACTIVE" | "RESOURCE_ERROR"; /** * Output only. Indicates the minimum duration for which a message is * retained after it is published to the subscription's topic. If this field * is set, messages published to the subscription's topic in the last * `topic_message_retention_duration` are always available to subscribers. See * the `message_retention_duration` field in `Topic`. This field is set only * in responses from the server; it is ignored if it is set in any requests. */ readonly topicMessageRetentionDuration?: number /* Duration */; } function serializeGooglePubsubV1Subscription(data: any): GooglePubsubV1Subscription { return { ...data, cloudStorageConfig: data["cloudStorageConfig"] !== undefined ? serializeCloudStorageConfig(data["cloudStorageConfig"]) : undefined, expirationPolicy: data["expirationPolicy"] !== undefined ? serializeExpirationPolicy(data["expirationPolicy"]) : undefined, messageRetentionDuration: data["messageRetentionDuration"] !== undefined ? data["messageRetentionDuration"] : undefined, retryPolicy: data["retryPolicy"] !== undefined ? serializeRetryPolicy(data["retryPolicy"]) : undefined, }; } function deserializeGooglePubsubV1Subscription(data: any): GooglePubsubV1Subscription { return { ...data, cloudStorageConfig: data["cloudStorageConfig"] !== undefined ? deserializeCloudStorageConfig(data["cloudStorageConfig"]) : undefined, expirationPolicy: data["expirationPolicy"] !== undefined ? deserializeExpirationPolicy(data["expirationPolicy"]) : undefined, messageRetentionDuration: data["messageRetentionDuration"] !== undefined ? data["messageRetentionDuration"] : undefined, retryPolicy: data["retryPolicy"] !== undefined ? deserializeRetryPolicy(data["retryPolicy"]) : undefined, topicMessageRetentionDuration: data["topicMessageRetentionDuration"] !== undefined ? data["topicMessageRetentionDuration"] : undefined, }; } /** * Reference to a linked resource tracked by this Subscription. */ export interface LinkedResource { /** * Output only. Name of the linked dataset, e.g. * projects/subscriberproject/datasets/linked_dataset */ readonly linkedDataset?: string; /** * Output only. Name of the Pub/Sub subscription, e.g. * projects/subscriberproject/subscriptions/subscriptions/sub_id */ readonly linkedPubsubSubscription?: string; /** * Output only. Listing for which linked resource is created. */ readonly listing?: string; } /** * Message for response to the list of data exchanges. */ export interface ListDataExchangesResponse { /** * The list of data exchanges. */ dataExchanges?: DataExchange[]; /** * A token to request the next page of results. */ nextPageToken?: string; } function serializeListDataExchangesResponse(data: any): ListDataExchangesResponse { return { ...data, dataExchanges: data["dataExchanges"] !== undefined ? data["dataExchanges"].map((item: any) => (serializeDataExchange(item))) : undefined, }; } function deserializeListDataExchangesResponse(data: any): ListDataExchangesResponse { return { ...data, dataExchanges: data["dataExchanges"] !== undefined ? data["dataExchanges"].map((item: any) => (deserializeDataExchange(item))) : undefined, }; } /** * A listing is what gets published into a data exchange that a subscriber can * subscribe to. It contains a reference to the data source along with * descriptive information that will help subscribers find and subscribe the * data. */ export interface Listing { /** * Required. Shared dataset i.e. BigQuery dataset source. */ bigqueryDataset?: BigQueryDatasetSource; /** * Optional. Categories of the listing. Up to two categories are allowed. */ categories?: | "CATEGORY_UNSPECIFIED" | "CATEGORY_OTHERS" | "CATEGORY_ADVERTISING_AND_MARKETING" | "CATEGORY_COMMERCE" | "CATEGORY_CLIMATE_AND_ENVIRONMENT" | "CATEGORY_DEMOGRAPHICS" | "CATEGORY_ECONOMICS" | "CATEGORY_EDUCATION" | "CATEGORY_ENERGY" | "CATEGORY_FINANCIAL" | "CATEGORY_GAMING" | "CATEGORY_GEOSPATIAL" | "CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE" | "CATEGORY_MEDIA" | "CATEGORY_PUBLIC_SECTOR" | "CATEGORY_RETAIL" | "CATEGORY_SPORTS" | "CATEGORY_SCIENCE_AND_RESEARCH" | "CATEGORY_TRANSPORTATION_AND_LOGISTICS" | "CATEGORY_TRAVEL_AND_TOURISM"[]; /** * Optional. Details of the data provider who owns the source data. */ dataProvider?: DataProvider; /** * Optional. Short description of the listing. The description must not * contain Unicode non-characters and C0 and C1 control codes except tabs * (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default * value is an empty string. Max length: 2000 bytes. */ description?: string; /** * Optional. Type of discovery of the listing on the discovery page. */ discoveryType?: | "DISCOVERY_TYPE_UNSPECIFIED" | "DISCOVERY_TYPE_PRIVATE" | "DISCOVERY_TYPE_PUBLIC"; /** * Required. Human-readable display name of the listing. The display name * must contain only Unicode letters, numbers (0-9), underscores (_), dashes * (-), spaces ( ), ampersands (&) and can't start or end with spaces. Default * value is an empty string. Max length: 63 bytes. */ displayName?: string; /** * Optional. Documentation describing the listing. */ documentation?: string; /** * Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB * Expected image dimensions are 512x512 pixels, however the API only performs * validation on size of the encoded data. Note: For byte fields, the contents * of the field are base64-encoded (which increases the size of the data by * 33-36%) when using JSON on the wire. */ icon?: Uint8Array; /** * Output only. The resource name of the listing. e.g. * `projects/myproject/locations/US/dataExchanges/123/listings/456` */ readonly name?: string; /** * Optional. Email or URL of the primary point of contact of the listing. Max * Length: 1000 bytes. */ primaryContact?: string; /** * Optional. Details of the publisher who owns the listing and who can share * the source data. */ publisher?: Publisher; /** * Required. Pub/Sub topic source. */ pubsubTopic?: PubSubTopicSource; /** * Optional. Email or URL of the request access of the listing. Subscribers * can use this reference to request access. Max Length: 1000 bytes. */ requestAccess?: string; /** * Output only. Listing shared asset type. */ readonly resourceType?: | "SHARED_RESOURCE_TYPE_UNSPECIFIED" | "BIGQUERY_DATASET" | "PUBSUB_TOPIC"; /** * Optional. If set, restricted export configuration will be propagated and * enforced on the linked dataset. */ restrictedExportConfig?: RestrictedExportConfig; /** * Output only. Current state of the listing. */ readonly state?: | "STATE_UNSPECIFIED" | "ACTIVE"; } function serializeListing(data: any): Listing { return { ...data, icon: data["icon"] !== undefined ? encodeBase64(data["icon"]) : undefined, }; } function deserializeListing(data: any): Listing { return { ...data, icon: data["icon"] !== undefined ? decodeBase64(data["icon"] as string) : undefined, }; } /** * Message for response to the list of Listings. */ export interface ListListingsResponse { /** * The list of Listing. */ listings?: Listing[]; /** * A token to request the next page of results. */ nextPageToken?: string; } function serializeListListingsResponse(data: any): ListListingsResponse { return { ...data, listings: data["listings"] !== undefined ? data["listings"].map((item: any) => (serializeListing(item))) : undefined, }; } function deserializeListListingsResponse(data: any): ListListingsResponse { return { ...data, listings: data["listings"] !== undefined ? data["listings"].map((item: any) => (deserializeListing(item))) : undefined, }; } /** * Message for response to listing data exchanges in an organization and * location. */ export interface ListOrgDataExchangesResponse { /** * The list of data exchanges. */ dataExchanges?: DataExchange[]; /** * A token to request the next page of results. */ nextPageToken?: string; } function serializeListOrgDataExchangesResponse(data: any): ListOrgDataExchangesResponse { return { ...data, dataExchanges: data["dataExchanges"] !== undefined ? data["dataExchanges"].map((item: any) => (serializeDataExchange(item))) : undefined, }; } function deserializeListOrgDataExchangesResponse(data: any): ListOrgDataExchangesResponse { return { ...data, dataExchanges: data["dataExchanges"] !== undefined ? data["dataExchanges"].map((item: any) => (deserializeDataExchange(item))) : undefined, }; } /** * Message for response to the listing of shared resource subscriptions. */ export interface ListSharedResourceSubscriptionsResponse { /** * Next page token. */ nextPageToken?: string; /** * The list of subscriptions. */ sharedResourceSubscriptions?: Subscription[]; } /** * Message for response to the listing of subscriptions. */ export interface ListSubscriptionsResponse { /** * Next page token. */ nextPageToken?: string; /** * The list of subscriptions. */ subscriptions?: Subscription[]; } /** * Sets the `data` field as the HTTP body for delivery. */ export interface NoWrapper { /** * Optional. When true, writes the Pub/Sub message metadata to * `x-goog-pubsub-:` headers of the HTTP request. Writes the Pub/Sub message * attributes to `:` headers of the HTTP request. */ writeMetadata?: boolean; } /** * Contains information needed for generating an [OpenID Connect * token](https://developers.google.com/identity/protocols/OpenIDConnect). */ export interface OidcToken { /** * Optional. Audience to be used when generating OIDC token. The audience * claim identifies the recipients that the JWT is intended for. The audience * value is a single case-sensitive string. Having multiple values (array) for * the audience field is not supported. More info about the OIDC JWT token * audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if * not specified, the Push endpoint URL will be used. */ audience?: string; /** * Optional. [Service account * email](https://cloud.google.com/iam/docs/service-accounts) used for * generating the OIDC token. For more information on setting up * authentication, see [Push * subscriptions](https://cloud.google.com/pubsub/docs/push). */ serviceAccountEmail?: 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 a long-running operation in Analytics Hub. */ 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 successfully been cancelled have * Operation.error value with a google.rpc.Status.code of 1, corresponding to * `Code.CANCELLED`. */ readonly requestedCancellation?: boolean; /** * Output only. Human-readable status of the operation, if any. */ readonly statusMessage?: string; /** * Output only. Server-defined resource path for the target of the operation. */ readonly target?: string; /** * Output only. Name of the verb executed by the operation. */ readonly verb?: string; } /** * Additional options for AnalyticsHub#organizationsLocationsDataExchangesList. */ export interface OrganizationsLocationsDataExchangesListOptions { /** * The maximum number of results to return in a single response page. * Leverage the page tokens to iterate through the entire collection. */ pageSize?: number; /** * Page token, returned by a previous call, to request the next page of * results. */ pageToken?: string; } /** * An Identity and Access Management (IAM) policy, which specifies access * controls for Google Cloud resources. A `Policy` is a collection of * `bindings`. A `binding` binds one or more `members`, or principals, to a * single `role`. Principals can be user accounts, service accounts, Google * groups, and domains (such as G Suite). A `role` is a named list of * permissions; each `role` can be an IAM predefined role or a user-created * custom role. For some types of Google Cloud resources, a `binding` can also * specify a `condition`, which is a logical expression that allows access to a * resource only if the expression evaluates to `true`. A condition can add * constraints based on attributes of the request, the resource, or both. To * learn which resources support conditions in their IAM policies, see the [IAM * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). * **JSON example:** ``` { "bindings": [ { "role": * "roles/resourcemanager.organizationAdmin", "members": [ * "user:mike@example.com", "group:admins@example.com", "domain:google.com", * "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": * "roles/resourcemanager.organizationViewer", "members": [ * "user:eve@example.com" ], "condition": { "title": "expirable access", * "description": "Does not grant access after Sep 2020", "expression": * "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": * "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: - members: * - user:mike@example.com - group:admins@example.com - domain:google.com - * serviceAccount:my-project-id@appspot.gserviceaccount.com role: * roles/resourcemanager.organizationAdmin - members: - user:eve@example.com * role: roles/resourcemanager.organizationViewer condition: title: expirable * access description: Does not grant access after Sep 2020 expression: * request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= * version: 3 ``` For a description of IAM and its features, see the [IAM * documentation](https://cloud.google.com/iam/docs/). */ export interface Policy { /** * Specifies cloud audit logging configuration for this policy. */ auditConfigs?: AuditConfig[]; /** * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. The * `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of * these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 * different roles to `user:alice@example.com`, and not to any other * principal, then you can add another 1,450 principals to the `bindings` in * the `Policy`. */ bindings?: Binding[]; /** * `etag` is used for optimistic concurrency control as a way to help prevent * simultaneous updates of a policy from overwriting each other. It is * strongly suggested that systems make use of the `etag` in the * read-modify-write cycle to perform policy updates in order to avoid race * conditions: An `etag` is returned in the response to `getIamPolicy`, and * systems are expected to put that etag in the request to `setIamPolicy` to * ensure that their change will be applied to the same version of the policy. * **Important:** If you use IAM Conditions, you must include the `etag` field * whenever you call `setIamPolicy`. If you omit this field, then IAM allows * you to overwrite a version `3` policy with a version `1` policy, and all of * the conditions in the version `3` policy are lost. */ etag?: Uint8Array; /** * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. * Requests that specify an invalid value are rejected. Any operation that * affects conditional role bindings must specify version `3`. This * requirement applies to the following operations: * Getting a policy that * includes a conditional role binding * Adding a conditional role binding to * a policy * Changing a conditional role binding in a policy * Removing any * role binding, with or without a condition, from a policy that includes * conditions **Important:** If you use IAM Conditions, you must include the * `etag` field whenever you call `setIamPolicy`. If you omit this field, then * IAM allows you to overwrite a version `3` policy with a version `1` policy, * and all of the conditions in the version `3` policy are lost. If a policy * does not include any conditions, operations on that policy may specify any * valid version or leave the field unset. To learn which resources support * conditions in their IAM policies, see the [IAM * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). */ version?: number; } function serializePolicy(data: any): Policy { return { ...data, etag: data["etag"] !== undefined ? encodeBase64(data["etag"]) : undefined, }; } function deserializePolicy(data: any): Policy { return { ...data, etag: data["etag"] !== undefined ? decodeBase64(data["etag"] as string) : undefined, }; } /** * Additional options for AnalyticsHub#projectsLocationsDataExchangesCreate. */ export interface ProjectsLocationsDataExchangesCreateOptions { /** * Required. The ID of the data exchange. Must contain only Unicode letters, * numbers (0-9), underscores (_). Should not use characters that require * URL-escaping, or characters outside of ASCII, spaces. Max length: 100 * bytes. */ dataExchangeId?: string; } /** * Additional options for * AnalyticsHub#projectsLocationsDataExchangesListingsCreate. */ export interface ProjectsLocationsDataExchangesListingsCreateOptions { /** * Required. The ID of the listing to create. Must contain only Unicode * letters, numbers (0-9), underscores (_). Should not use characters that * require URL-escaping, or characters outside of ASCII, spaces. Max length: * 100 bytes. */ listingId?: string; } /** * Additional options for * AnalyticsHub#projectsLocationsDataExchangesListingsList. */ export interface ProjectsLocationsDataExchangesListingsListOptions { /** * The maximum number of results to return in a single response page. * Leverage the page tokens to iterate through the entire collection. */ pageSize?: number; /** * Page token, returned by a previous call, to request the next page of * results. */ pageToken?: string; } /** * Additional options for * AnalyticsHub#projectsLocationsDataExchangesListingsListSubscriptions. */ export interface ProjectsLocationsDataExchangesListingsListSubscriptionsOptions { /** * If selected, includes deleted subscriptions in the response (up to 63 days * after deletion). */ includeDeletedSubscriptions?: boolean; /** * The maximum number of results to return in a single response page. */ pageSize?: number; /** * Page token, returned by a previous call. */ pageToken?: string; } /** * Additional options for * AnalyticsHub#projectsLocationsDataExchangesListingsPatch. */ export interface ProjectsLocationsDataExchangesListingsPatchOptions { /** * Required. Field mask specifies the fields to update in the listing * resource. The fields specified in the `updateMask` are relative to the * resource and are not a full request. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsDataExchangesListingsPatchOptions(data: any): ProjectsLocationsDataExchangesListingsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsDataExchangesListingsPatchOptions(data: any): ProjectsLocationsDataExchangesListingsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for AnalyticsHub#projectsLocationsDataExchangesList. */ export interface ProjectsLocationsDataExchangesListOptions { /** * The maximum number of results to return in a single response page. * Leverage the page tokens to iterate through the entire collection. */ pageSize?: number; /** * Page token, returned by a previous call, to request the next page of * results. */ pageToken?: string; } /** * Additional options for * AnalyticsHub#projectsLocationsDataExchangesListSubscriptions. */ export interface ProjectsLocationsDataExchangesListSubscriptionsOptions { /** * If selected, includes deleted subscriptions in the response (up to 63 days * after deletion). */ includeDeletedSubscriptions?: boolean; /** * The maximum number of results to return in a single response page. */ pageSize?: number; /** * Page token, returned by a previous call. */ pageToken?: string; } /** * Additional options for AnalyticsHub#projectsLocationsDataExchangesPatch. */ export interface ProjectsLocationsDataExchangesPatchOptions { /** * Required. Field mask specifies the fields to update in the data exchange * resource. The fields specified in the `updateMask` are relative to the * resource and are not a full request. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsDataExchangesPatchOptions(data: any): ProjectsLocationsDataExchangesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsDataExchangesPatchOptions(data: any): ProjectsLocationsDataExchangesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for AnalyticsHub#projectsLocationsSubscriptionsList. */ export interface ProjectsLocationsSubscriptionsListOptions { /** * An expression for filtering the results of the request. Eligible fields * for filtering are: + `listing` + `data_exchange` Alternatively, a literal * wrapped in double quotes may be provided. This will be checked for an exact * match against both fields above. In all cases, the full Data Exchange or * Listing resource name must be provided. Some example of using filters: + * data_exchange="projects/myproject/locations/us/dataExchanges/123" + * listing="projects/123/locations/us/dataExchanges/456/listings/789" + * "projects/myproject/locations/us/dataExchanges/123" */ filter?: string; /** * The maximum number of results to return in a single response page. */ pageSize?: number; /** * Page token, returned by a previous call. */ pageToken?: string; } /** * Contains details of the listing publisher. */ export interface Publisher { /** * Optional. Name of the listing publisher. */ name?: string; /** * Optional. Email or URL of the listing publisher. Max Length: 1000 bytes. */ primaryContact?: string; } /** * Pub/Sub topic source. */ export interface PubSubTopicSource { /** * Optional. Region hint on where the data might be published. Data affinity * regions are modifiable. See go/regions for full listing of possible Cloud * regions. */ dataAffinityRegions?: string[]; /** * Required. Resource name of the Pub/Sub topic source for this listing. e.g. * projects/myproject/topics/topicId */ topic?: string; } /** * The payload to the push endpoint is in the form of the JSON representation * of a PubsubMessage * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). */ export interface PubsubWrapper { } /** * Configuration for a push delivery endpoint. */ export interface PushConfig { /** * Optional. Endpoint configuration attributes that can be used to control * different aspects of the message delivery. The only currently supported * attribute is `x-goog-version`, which you can use to change the format of * the pushed message. This attribute indicates the version of the data * expected by the endpoint. This controls the shape of the pushed message * (i.e., its fields and metadata). If not present during the * `CreateSubscription` call, it will default to the version of the Pub/Sub * API used to make such call. If not present in a `ModifyPushConfig` call, * its value will not be changed. `GetSubscription` calls will always return a * valid version, even if the subscription was created without this attribute. * The only supported values for the `x-goog-version` attribute are: * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. * `v1` * or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. For * example: `attributes { "x-goog-version": "v1" }` */ attributes?: { [key: string]: string }; /** * Optional. When set, the payload to the push endpoint is not wrapped. */ noWrapper?: NoWrapper; /** * Optional. If specified, Pub/Sub will generate and attach an OIDC JWT token * as an `Authorization` header in the HTTP request for every pushed message. */ oidcToken?: OidcToken; /** * Optional. When set, the payload to the push endpoint is in the form of the * JSON representation of a PubsubMessage * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). */ pubsubWrapper?: PubsubWrapper; /** * Optional. A URL locating the endpoint to which messages should be pushed. * For example, a Webhook endpoint might use `https://example.com/push`. */ pushEndpoint?: string; } /** * Message for refreshing a subscription. */ export interface RefreshSubscriptionRequest { } /** * Message for response when you refresh a subscription. */ export interface RefreshSubscriptionResponse { /** * The refreshed subscription resource. */ subscription?: Subscription; } /** * Restricted export config, used to configure restricted export on linked * dataset. */ export interface RestrictedExportConfig { /** * Optional. If true, enable restricted export. */ enabled?: boolean; /** * Output only. If true, restrict direct table access(read * api/tabledata.list) on linked table. */ readonly restrictDirectTableAccess?: boolean; /** * Optional. If true, restrict export of query result derived from restricted * linked dataset table. */ restrictQueryResult?: boolean; } /** * Restricted export policy used to configure restricted export on linked * dataset. */ export interface RestrictedExportPolicy { /** * Optional. If true, enable restricted export. */ enabled?: boolean; /** * Optional. If true, restrict direct table access (read api/tabledata.list) * on linked table. */ restrictDirectTableAccess?: boolean; /** * Optional. If true, restrict export of query result derived from restricted * linked dataset table. */ restrictQueryResult?: boolean; } /** * A policy that specifies how Pub/Sub retries message delivery. Retry delay * will be exponential based on provided minimum and maximum backoffs. * https://en.wikipedia.org/wiki/Exponential_backoff. RetryPolicy will be * triggered on NACKs or acknowledgement deadline exceeded events for a given * message. Retry Policy is implemented on a best effort basis. At times, the * delay between consecutive deliveries may not match the configuration. That * is, delay can be more or less than configured backoff. */ export interface RetryPolicy { /** * Optional. The maximum delay between consecutive deliveries of a given * message. Value should be between 0 and 600 seconds. Defaults to 600 * seconds. */ maximumBackoff?: number /* Duration */; /** * Optional. The minimum delay between consecutive deliveries of a given * message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. */ minimumBackoff?: number /* Duration */; } function serializeRetryPolicy(data: any): RetryPolicy { return { ...data, maximumBackoff: data["maximumBackoff"] !== undefined ? data["maximumBackoff"] : undefined, minimumBackoff: data["minimumBackoff"] !== undefined ? data["minimumBackoff"] : undefined, }; } function deserializeRetryPolicy(data: any): RetryPolicy { return { ...data, maximumBackoff: data["maximumBackoff"] !== undefined ? data["maximumBackoff"] : undefined, minimumBackoff: data["minimumBackoff"] !== undefined ? data["minimumBackoff"] : undefined, }; } /** * Message for revoking a subscription. */ export interface RevokeSubscriptionRequest { } /** * Message for response when you revoke a subscription. Empty for now. */ export interface RevokeSubscriptionResponse { } /** * Resource in this dataset that is selectively shared. */ export interface SelectedResource { /** * Optional. Format: For table: * `projects/{projectId}/datasets/{datasetId}/tables/{tableId}` * Example:"projects/test_project/datasets/test_dataset/tables/test_table" */ table?: string; } /** * Request message for `SetIamPolicy` method. */ export interface SetIamPolicyRequest { /** * REQUIRED: The complete policy to be applied to the `resource`. The size of * the policy is limited to a few 10s of KB. An empty policy is a valid policy * but certain Google Cloud services (such as Projects) might reject them. */ policy?: Policy; /** * OPTIONAL: A FieldMask specifying which fields of the policy to modify. * Only the fields in the mask will be modified. If no mask is provided, the * following default mask is used: `paths: "bindings, etag"` */ updateMask?: string /* FieldMask */; } function serializeSetIamPolicyRequest(data: any): SetIamPolicyRequest { return { ...data, policy: data["policy"] !== undefined ? serializePolicy(data["policy"]) : undefined, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeSetIamPolicyRequest(data: any): SetIamPolicyRequest { return { ...data, policy: data["policy"] !== undefined ? deserializePolicy(data["policy"]) : undefined, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Sharing environment is a behavior model for sharing data within a data * exchange. This option is configurable for a data exchange. */ export interface SharingEnvironmentConfig { /** * Data Clean Room (DCR), used for privacy-safe and secured data sharing. */ dcrExchangeConfig?: DcrExchangeConfig; /** * Default Analytics Hub data exchange, used for secured data sharing. */ defaultExchangeConfig?: DefaultExchangeConfig; } /** * The `Status` type defines a logical error model that is suitable for * different programming environments, including REST APIs and RPC APIs. It is * used by [gRPC](https://github.com/grpc). Each `Status` message contains three * pieces of data: error code, error message, and error details. You can find * out more about this error model and how to work with it in the [API Design * Guide](https://cloud.google.com/apis/design/errors). */ export interface Status { /** * The status code, which should be an enum value of google.rpc.Code. */ code?: number; /** * A list of messages that carry the error details. There is a common set of * message types for APIs to use. */ details?: { [key: string]: any }[]; /** * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the * google.rpc.Status.details field, or localized by the client. */ message?: string; } /** * Message for subscribing to a Data Exchange. */ export interface SubscribeDataExchangeRequest { /** * Required. The parent resource path of the Subscription. e.g. * `projects/subscriberproject/locations/US` */ destination?: string; /** * Optional. BigQuery destination dataset to create for the subscriber. */ destinationDataset?: DestinationDataset; /** * Email of the subscriber. */ subscriberContact?: string; /** * Required. Name of the subscription to create. e.g. `subscription1` */ subscription?: string; } /** * Message for response when you subscribe to a Data Exchange. */ export interface SubscribeDataExchangeResponse { /** * Subscription object created from this subscribe action. */ subscription?: Subscription; } /** * Message for subscribing to a listing. */ export interface SubscribeListingRequest { /** * Input only. BigQuery destination dataset to create for the subscriber. */ destinationDataset?: DestinationDataset; /** * Required. Input only. Destination Pub/Sub subscription to create for the * subscriber. */ destinationPubsubSubscription?: DestinationPubSubSubscription; } function serializeSubscribeListingRequest(data: any): SubscribeListingRequest { return { ...data, destinationPubsubSubscription: data["destinationPubsubSubscription"] !== undefined ? serializeDestinationPubSubSubscription(data["destinationPubsubSubscription"]) : undefined, }; } function deserializeSubscribeListingRequest(data: any): SubscribeListingRequest { return { ...data, destinationPubsubSubscription: data["destinationPubsubSubscription"] !== undefined ? deserializeDestinationPubSubSubscription(data["destinationPubsubSubscription"]) : undefined, }; } /** * Message for response when you subscribe to a listing. */ export interface SubscribeListingResponse { /** * Subscription object created from this subscribe action. */ subscription?: Subscription; } /** * A subscription represents a subscribers' access to a particular set of * published data. It contains references to associated listings, data * exchanges, and linked datasets. */ export interface Subscription { /** * Output only. Timestamp when the subscription was created. */ readonly creationTime?: Date; /** * Output only. Resource name of the source Data Exchange. e.g. * projects/123/locations/US/dataExchanges/456 */ readonly dataExchange?: string; /** * Output only. Timestamp when the subscription was last modified. */ readonly lastModifyTime?: Date; /** * Output only. Map of listing resource names to associated linked resource, * e.g. projects/123/locations/US/dataExchanges/456/listings/789 -> * projects/123/datasets/my_dataset For listing-level subscriptions, this is a * map of size 1. Only contains values if state == STATE_ACTIVE. */ readonly linkedDatasetMap?: { [key: string]: LinkedResource }; /** * Output only. Linked resources created in the subscription. Only contains * values if state = STATE_ACTIVE. */ readonly linkedResources?: LinkedResource[]; /** * Output only. Resource name of the source Listing. e.g. * projects/123/locations/US/dataExchanges/456/listings/789 */ readonly listing?: string; /** * Output only. The resource name of the subscription. e.g. * `projects/myproject/locations/US/subscriptions/123`. */ readonly name?: string; /** * Output only. Display name of the project of this subscription. */ readonly organizationDisplayName?: string; /** * Output only. Organization of the project this subscription belongs to. */ readonly organizationId?: string; /** * Output only. Listing shared asset type. */ readonly resourceType?: | "SHARED_RESOURCE_TYPE_UNSPECIFIED" | "BIGQUERY_DATASET" | "PUBSUB_TOPIC"; /** * Output only. Current state of the subscription. */ readonly state?: | "STATE_UNSPECIFIED" | "STATE_ACTIVE" | "STATE_STALE" | "STATE_INACTIVE"; /** * Output only. Email of the subscriber. */ readonly subscriberContact?: string; } /** * Request message for `TestIamPermissions` method. */ export interface TestIamPermissionsRequest { /** * The set of permissions to check for the `resource`. Permissions with * wildcards (such as `*` or `storage.*`) are not allowed. For more * information see [IAM * Overview](https://cloud.google.com/iam/docs/overview#permissions). */ permissions?: string[]; } /** * Response message for `TestIamPermissions` method. */ export interface TestIamPermissionsResponse { /** * A subset of `TestPermissionsRequest.permissions` that the caller is * allowed. */ permissions?: string[]; } /** * Configuration for writing message data in text format. Message payloads will * be written to files as raw text, separated by a newline. */ export interface TextConfig { } 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; }