// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Dataproc Metastore API Client for Deno * ====================================== * * The Dataproc Metastore API is used to manage the lifecycle and configuration of metastore services. * * Docs: https://cloud.google.com/dataproc-metastore/docs * Source: https://googleapis.deno.dev/v1/metastore:v2.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * The Dataproc Metastore API is used to manage the lifecycle and configuration * of metastore services. */ export class Metastore { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://metastore.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Alter metadata resource location. The metadata resource can be a database, * table, or partition. This functionality only updates the parent directory * for the respective metadata resource and does not transfer any existing * data to the new location. * * @param service Required. The relative resource name of the metastore service to mutate metadata, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}. */ async projectsLocationsServicesAlterLocation(service: string, req: GoogleCloudMetastoreV2AlterMetadataResourceLocationRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ service }:alterLocation`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Alter metadata table properties. * * @param service Required. The relative resource name of the Dataproc Metastore service that's being used to mutate metadata table properties, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}. */ async projectsLocationsServicesAlterTableProperties(service: string, req: GoogleCloudMetastoreV2AlterTablePropertiesRequest): Promise { req = serializeGoogleCloudMetastoreV2AlterTablePropertiesRequest(req); const url = new URL(`${this.#baseUrl}v2/${ service }:alterTableProperties`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Creates a new backup in a given project and location. * * @param parent Required. The relative resource name of the service in which to create a backup of the following form:projects/{project_number}/locations/{location_id}/services/{service_id}. */ async projectsLocationsServicesBackupsCreate(parent: string, req: GoogleCloudMetastoreV2Backup, opts: ProjectsLocationsServicesBackupsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/backups`); if (opts.backupId !== undefined) { url.searchParams.append("backupId", String(opts.backupId)); } 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 GoogleLongrunningOperation; } /** * Deletes a single backup. * * @param name Required. The relative resource name of the backup to delete, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}. */ async projectsLocationsServicesBackupsDelete(name: string, opts: ProjectsLocationsServicesBackupsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ 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 GoogleLongrunningOperation; } /** * Gets details of a single backup. * * @param name Required. The relative resource name of the backup to retrieve, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}. */ async projectsLocationsServicesBackupsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleCloudMetastoreV2Backup; } /** * Lists backups in a service. * * @param parent Required. The relative resource name of the service whose backups to list, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/backups. */ async projectsLocationsServicesBackupsList(parent: string, opts: ProjectsLocationsServicesBackupsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/backups`); 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 data as GoogleCloudMetastoreV2ListBackupsResponse; } /** * Creates a metastore service in a project and location. * * @param parent Required. The relative resource name of the location in which to create a metastore service, in the following form:projects/{project_number}/locations/{location_id}. */ async projectsLocationsServicesCreate(parent: string, req: GoogleCloudMetastoreV2Service, opts: ProjectsLocationsServicesCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/services`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.serviceId !== undefined) { url.searchParams.append("serviceId", String(opts.serviceId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Deletes a single service. * * @param name Required. The relative resource name of the metastore service to delete, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}. */ async projectsLocationsServicesDelete(name: string, opts: ProjectsLocationsServicesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ 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 GoogleLongrunningOperation; } /** * Exports metadata from a service. * * @param service Required. The relative resource name of the metastore service to run export, in the following form:projects/{project_id}/locations/{location_id}/services/{service_id}. */ async projectsLocationsServicesExportMetadata(service: string, req: GoogleCloudMetastoreV2ExportMetadataRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ service }:exportMetadata`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Gets the details of a single service. * * @param name Required. The relative resource name of the metastore service to retrieve, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}. */ async projectsLocationsServicesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleCloudMetastoreV2Service; } /** * Imports Metadata into a Dataproc Metastore service. * * @param name Immutable. The relative resource name of the metastore service to run import, in the following form:projects/{project_id}/locations/{location_id}/services/{service_id}. */ async projectsLocationsServicesImportMetadata(name: string, req: GoogleCloudMetastoreV2ImportMetadataRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }:importMetadata`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Lists services in a project and location. * * @param parent Required. The relative resource name of the location of metastore services to list, in the following form:projects/{project_number}/locations/{location_id}. */ async projectsLocationsServicesList(parent: string, opts: ProjectsLocationsServicesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/services`); 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 data as GoogleCloudMetastoreV2ListServicesResponse; } /** * Move a table to another database. * * @param service Required. The relative resource name of the metastore service to mutate metadata, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}. */ async projectsLocationsServicesMoveTableToDatabase(service: string, req: GoogleCloudMetastoreV2MoveTableToDatabaseRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ service }:moveTableToDatabase`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Updates the parameters of a single service. * * @param name Immutable. The relative resource name of the metastore service, in the following format:projects/{project_number}/locations/{location_id}/services/{service_id}. */ async projectsLocationsServicesPatch(name: string, req: GoogleCloudMetastoreV2Service, opts: ProjectsLocationsServicesPatchOptions = {}): Promise { opts = serializeProjectsLocationsServicesPatchOptions(opts); const url = new URL(`${this.#baseUrl}v2/${ 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 GoogleLongrunningOperation; } /** * Query Dataproc Metastore metadata. * * @param service Required. The relative resource name of the metastore service to query metadata, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}. */ async projectsLocationsServicesQueryMetadata(service: string, req: GoogleCloudMetastoreV2QueryMetadataRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ service }:queryMetadata`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Restores a service from a backup. * * @param service Required. The relative resource name of the metastore service to run restore, in the following form:projects/{project_id}/locations/{location_id}/services/{service_id}. */ async projectsLocationsServicesRestore(service: string, req: GoogleCloudMetastoreV2RestoreServiceRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ service }:restore`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } } /** * Response message for DataprocMetastore.AlterMetadataResourceLocation. */ export interface GoogleCloudMetastoreV1alphaAlterMetadataResourceLocationResponse { } /** * Response message for DataprocMetastore.CancelMigration. */ export interface GoogleCloudMetastoreV1alphaCancelMigrationResponse { /** * The relative resource name of the migration execution, in the following * form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}. */ migrationExecution?: string; } /** * Response message for DataprocMetastore.CompleteMigration. */ export interface GoogleCloudMetastoreV1alphaCompleteMigrationResponse { /** * The relative resource name of the migration execution, in the following * form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}. */ migrationExecution?: string; } /** * Metadata about a custom region. This is only populated if the region is a * custom region. For single/multi regions, it will be empty. */ export interface GoogleCloudMetastoreV1alphaCustomRegionMetadata { /** * The read-only regions for this custom region. */ optionalReadOnlyRegions?: string[]; /** * The read-write regions for this custom region. */ requiredReadWriteRegions?: string[]; /** * The Spanner witness region for this custom region. */ witnessRegion?: string; } /** * Error details in public error message for DataprocMetastore.QueryMetadata. */ export interface GoogleCloudMetastoreV1alphaErrorDetails { /** * Additional structured details about this error.Keys define the failure * items. Value describes the exception or details of the item. */ details?: { [key: string]: string }; } /** * A specification of a supported version of the Hive Metastore software. */ export interface GoogleCloudMetastoreV1alphaHiveMetastoreVersion { /** * Whether version will be chosen by the server if a metastore service is * created with a HiveMetastoreConfig that omits the version. */ isDefault?: boolean; /** * The semantic version of the Hive Metastore software. */ version?: string; } /** * Metadata about the service in a location. */ export interface GoogleCloudMetastoreV1alphaLocationMetadata { /** * Possible configurations supported if the current region is a custom * region. */ customRegionMetadata?: GoogleCloudMetastoreV1alphaCustomRegionMetadata[]; /** * The multi-region metadata if the current region is a multi-region. */ multiRegionMetadata?: GoogleCloudMetastoreV1alphaMultiRegionMetadata; /** * The versions of Hive Metastore that can be used when creating a new * metastore service in this location. The server guarantees that exactly one * HiveMetastoreVersion in the list will set is_default. */ supportedHiveMetastoreVersions?: GoogleCloudMetastoreV1alphaHiveMetastoreVersion[]; } /** * Response message for DataprocMetastore.MoveTableToDatabase. */ export interface GoogleCloudMetastoreV1alphaMoveTableToDatabaseResponse { } /** * The metadata for the multi-region that includes the constituent regions. The * metadata is only populated if the region is multi-region. For single region * or custom dual region, it will be empty. */ export interface GoogleCloudMetastoreV1alphaMultiRegionMetadata { /** * The regions constituting the multi-region. */ constituentRegions?: string[]; } /** * Represents the metadata of a long-running operation. */ export interface GoogleCloudMetastoreV1alphaOperationMetadata { /** * 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 caller has requested cancellation of * the operation. Operations that have successfully been cancelled have * google.longrunning.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; } /** * Response message for DataprocMetastore.QueryMetadata. */ export interface GoogleCloudMetastoreV1alphaQueryMetadataResponse { /** * The manifest URI is link to a JSON instance in Cloud Storage. This * instance manifests immediately along with QueryMetadataResponse. The * content of the URI is not retriable until the long-running operation query * against the metadata finishes. */ resultManifestUri?: string; } /** * Response message for DataprocMetastore.AlterMetadataResourceLocation. */ export interface GoogleCloudMetastoreV1AlterMetadataResourceLocationResponse { } /** * Response message for DataprocMetastore.AlterMetadataResourceLocation. */ export interface GoogleCloudMetastoreV1betaAlterMetadataResourceLocationResponse { } /** * Response message for DataprocMetastore.CancelMigration. */ export interface GoogleCloudMetastoreV1betaCancelMigrationResponse { /** * The relative resource name of the migration execution, in the following * form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}. */ migrationExecution?: string; } /** * Response message for DataprocMetastore.CompleteMigration. */ export interface GoogleCloudMetastoreV1betaCompleteMigrationResponse { /** * The relative resource name of the migration execution, in the following * form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}. */ migrationExecution?: string; } /** * Metadata about a custom region. This is only populated if the region is a * custom region. For single/multi regions, it will be empty. */ export interface GoogleCloudMetastoreV1betaCustomRegionMetadata { /** * The read-only regions for this custom region. */ optionalReadOnlyRegions?: string[]; /** * The read-write regions for this custom region. */ requiredReadWriteRegions?: string[]; /** * The Spanner witness region for this custom region. */ witnessRegion?: string; } /** * Error details in public error message for DataprocMetastore.QueryMetadata. */ export interface GoogleCloudMetastoreV1betaErrorDetails { /** * Additional structured details about this error.Keys define the failure * items. Value describes the exception or details of the item. */ details?: { [key: string]: string }; } /** * A specification of a supported version of the Hive Metastore software. */ export interface GoogleCloudMetastoreV1betaHiveMetastoreVersion { /** * Whether version will be chosen by the server if a metastore service is * created with a HiveMetastoreConfig that omits the version. */ isDefault?: boolean; /** * The semantic version of the Hive Metastore software. */ version?: string; } /** * Metadata about the service in a location. */ export interface GoogleCloudMetastoreV1betaLocationMetadata { /** * Possible configurations supported if the current region is a custom * region. */ customRegionMetadata?: GoogleCloudMetastoreV1betaCustomRegionMetadata[]; /** * The multi-region metadata if the current region is a multi-region. */ multiRegionMetadata?: GoogleCloudMetastoreV1betaMultiRegionMetadata; /** * The versions of Hive Metastore that can be used when creating a new * metastore service in this location. The server guarantees that exactly one * HiveMetastoreVersion in the list will set is_default. */ supportedHiveMetastoreVersions?: GoogleCloudMetastoreV1betaHiveMetastoreVersion[]; } /** * Response message for DataprocMetastore.MoveTableToDatabase. */ export interface GoogleCloudMetastoreV1betaMoveTableToDatabaseResponse { } /** * The metadata for the multi-region that includes the constituent regions. The * metadata is only populated if the region is multi-region. For single region * or custom dual region, it will be empty. */ export interface GoogleCloudMetastoreV1betaMultiRegionMetadata { /** * The regions constituting the multi-region. */ constituentRegions?: string[]; } /** * Represents the metadata of a long-running operation. */ export interface GoogleCloudMetastoreV1betaOperationMetadata { /** * 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 caller has requested cancellation of * the operation. Operations that have successfully been cancelled have * google.longrunning.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; } /** * Response message for DataprocMetastore.QueryMetadata. */ export interface GoogleCloudMetastoreV1betaQueryMetadataResponse { /** * The manifest URI is link to a JSON instance in Cloud Storage. This * instance manifests immediately along with QueryMetadataResponse. The * content of the URI is not retriable until the long-running operation query * against the metadata finishes. */ resultManifestUri?: string; } /** * Metadata about a custom region. This is only populated if the region is a * custom region. For single/multi regions, it will be empty. */ export interface GoogleCloudMetastoreV1CustomRegionMetadata { /** * The read-only regions for this custom region. */ optionalReadOnlyRegions?: string[]; /** * The read-write regions for this custom region. */ requiredReadWriteRegions?: string[]; /** * The Spanner witness region for this custom region. */ witnessRegion?: string; } /** * Error details in public error message for DataprocMetastore.QueryMetadata. */ export interface GoogleCloudMetastoreV1ErrorDetails { /** * Additional structured details about this error.Keys define the failure * items. Value describes the exception or details of the item. */ details?: { [key: string]: string }; } /** * A specification of a supported version of the Hive Metastore software. */ export interface GoogleCloudMetastoreV1HiveMetastoreVersion { /** * Whether version will be chosen by the server if a metastore service is * created with a HiveMetastoreConfig that omits the version. */ isDefault?: boolean; /** * The semantic version of the Hive Metastore software. */ version?: string; } /** * Metadata about the service in a location. */ export interface GoogleCloudMetastoreV1LocationMetadata { /** * Possible configurations supported if the current region is a custom * region. */ customRegionMetadata?: GoogleCloudMetastoreV1CustomRegionMetadata[]; /** * The multi-region metadata if the current region is a multi-region. */ multiRegionMetadata?: GoogleCloudMetastoreV1MultiRegionMetadata; /** * The versions of Hive Metastore that can be used when creating a new * metastore service in this location. The server guarantees that exactly one * HiveMetastoreVersion in the list will set is_default. */ supportedHiveMetastoreVersions?: GoogleCloudMetastoreV1HiveMetastoreVersion[]; } /** * Response message for DataprocMetastore.MoveTableToDatabase. */ export interface GoogleCloudMetastoreV1MoveTableToDatabaseResponse { } /** * The metadata for the multi-region that includes the constituent regions. The * metadata is only populated if the region is multi-region. For single region * or custom dual region, it will be empty. */ export interface GoogleCloudMetastoreV1MultiRegionMetadata { /** * The regions constituting the multi-region. */ constituentRegions?: string[]; } /** * Represents the metadata of a long-running operation. */ export interface GoogleCloudMetastoreV1OperationMetadata { /** * 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 caller has requested cancellation of * the operation. Operations that have successfully been cancelled have * google.longrunning.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; } /** * Response message for DataprocMetastore.QueryMetadata. */ export interface GoogleCloudMetastoreV1QueryMetadataResponse { /** * The manifest URI is link to a JSON instance in Cloud Storage. This * instance manifests immediately along with QueryMetadataResponse. The * content of the URI is not retriable until the long-running operation query * against the metadata finishes. */ resultManifestUri?: string; } /** * Request message for DataprocMetastore.AlterMetadataResourceLocation. */ export interface GoogleCloudMetastoreV2AlterMetadataResourceLocationRequest { /** * Required. The new location URI for the metadata resource. */ locationUri?: string; /** * Required. The relative metadata resource name in the following * format.databases/{database_id} or databases/{database_id}/tables/{table_id} * or databases/{database_id}/tables/{table_id}/partitions/{partition_id} */ resourceName?: string; } /** * Request message for DataprocMetastore.AlterTableProperties. */ export interface GoogleCloudMetastoreV2AlterTablePropertiesRequest { /** * A map that describes the desired values to mutate. If update_mask is * empty, the properties will not update. Otherwise, the properties only * alters the value whose associated paths exist in the update mask */ properties?: { [key: string]: string }; /** * Required. The name of the table containing the properties you're altering * in the following format.databases/{database_id}/tables/{table_id} */ tableName?: string; /** * A field mask that specifies the metadata table properties that are * overwritten by the update. Fields specified in the update_mask are relative * to the resource (not to the full request). A field is overwritten if it is * in the mask.For example, given the target properties: properties { a: 1 b: * 2 } And an update properties: properties { a: 2 b: 3 c: 4 } then if the * field mask is:paths: "properties.b", "properties.c"then the result will be: * properties { a: 1 b: 3 c: 4 } */ updateMask?: string /* FieldMask */; } function serializeGoogleCloudMetastoreV2AlterTablePropertiesRequest(data: any): GoogleCloudMetastoreV2AlterTablePropertiesRequest { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeGoogleCloudMetastoreV2AlterTablePropertiesRequest(data: any): GoogleCloudMetastoreV2AlterTablePropertiesRequest { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Configuration information for the auxiliary service versions. */ export interface GoogleCloudMetastoreV2AuxiliaryVersionConfig { /** * A mapping of Hive metastore configuration key-value pairs to apply to the * auxiliary Hive metastore (configured in hive-site.xml) in addition to the * primary version's overrides. If keys are present in both the auxiliary * version's overrides and the primary version's overrides, the value from the * auxiliary version's overrides takes precedence. */ configOverrides?: { [key: string]: string }; /** * Output only. The list of endpoints used to access the auxiliary metastore * service, includes version and region data. */ readonly endpoints?: GoogleCloudMetastoreV2Endpoint[]; /** * The Hive metastore version of the auxiliary service. It must be less than * the primary Hive metastore service's version. */ version?: string; } /** * The details of a backup resource. */ export interface GoogleCloudMetastoreV2Backup { /** * Output only. The time when the backup was started. */ readonly createTime?: Date; /** * The description of the backup. */ description?: string; /** * Output only. The time when the backup finished creating. */ readonly endTime?: Date; /** * Immutable. The relative resource name of the backup, in the following * form:projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id} */ name?: string; /** * Output only. Services that are restoring from the backup. */ readonly restoringServices?: string[]; /** * Output only. The revision of the service at the time of backup. */ readonly serviceRevision?: GoogleCloudMetastoreV2Service; /** * Output only. The current state of the backup. */ readonly state?: | "STATE_UNSPECIFIED" | "CREATING" | "DELETING" | "ACTIVE" | "FAILED" | "RESTORING"; } /** * A specification of the location of and metadata about a database dump from a * relational database management system. */ export interface GoogleCloudMetastoreV2DatabaseDump { /** * Required. A Cloud Storage object or folder URI that specifies the source * from which to import metadata. It must begin with gs://. */ gcsUri?: string; /** * Optional. The type of the database dump. If unspecified, defaults to * MYSQL. */ type?: | "TYPE_UNSPECIFIED" | "MYSQL" | "AVRO"; } /** * Specifies how metastore metadata should be integrated with the Data Catalog * service. */ export interface GoogleCloudMetastoreV2DataCatalogConfig { /** * Optional. Defines whether the metastore metadata should be synced to Data * Catalog. The default value is to disable syncing metastore metadata to Data * Catalog. */ enabled?: boolean; } /** * Encryption settings for the service. */ export interface GoogleCloudMetastoreV2EncryptionConfig { } /** * An endpoint used to access the metastore service. */ export interface GoogleCloudMetastoreV2Endpoint { /** * Output only. The URI of the endpoint used to access the metastore service. */ readonly endpointUri?: string; /** * Output only. The region where the endpoint is located. */ readonly region?: string; } /** * Request message for DataprocMetastore.ExportMetadata. */ export interface GoogleCloudMetastoreV2ExportMetadataRequest { /** * Optional. The type of the database dump. If unspecified, defaults to * MYSQL. */ databaseDumpType?: | "TYPE_UNSPECIFIED" | "MYSQL" | "AVRO"; /** * A Cloud Storage URI of a folder, in the format gs:///. A sub-folder * containing exported files will be created below it. */ destinationGcsFolder?: string; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent * requests that provide a duplicate request ID for at least 60 minutes after * the first request.For example, if an initial request times out, followed by * another request with the same request ID, the server ignores the second * request to prevent the creation of duplicate commitments.The request ID * must be a valid UUID * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). A * zero UUID (00000000-0000-0000-0000-000000000000) is not supported. */ requestId?: string; } /** * Specifies configuration information specific to running Hive metastore * software as the metastore service. */ export interface GoogleCloudMetastoreV2HiveMetastoreConfig { /** * Optional. A mapping of Hive metastore version to the auxiliary version * configuration. When specified, a secondary Hive metastore service is * created along with the primary service. All auxiliary versions must be less * than the service's primary version. The key is the auxiliary service name * and it must match the regular expression a-z?. This means that the first * character must be a lowercase letter, and all the following characters must * be hyphens, lowercase letters, or digits, except the last character, which * cannot be a hyphen. */ auxiliaryVersions?: { [key: string]: GoogleCloudMetastoreV2AuxiliaryVersionConfig }; /** * Optional. A mapping of Hive metastore configuration key-value pairs to * apply to the Hive metastore (configured in hive-site.xml). The mappings * override system defaults (some keys cannot be overridden). These overrides * are also applied to auxiliary versions and can be further customized in the * auxiliary version's AuxiliaryVersionConfig. */ configOverrides?: { [key: string]: string }; /** * Optional. The protocol to use for the metastore service endpoint. If * unspecified, defaults to GRPC. */ endpointProtocol?: | "ENDPOINT_PROTOCOL_UNSPECIFIED" | "THRIFT" | "GRPC"; /** * Immutable. The Hive metastore schema version. */ version?: string; } /** * Request message for DataprocMetastore.CreateMetadataImport. */ export interface GoogleCloudMetastoreV2ImportMetadataRequest { /** * Immutable. A database dump from a pre-existing metastore's database. */ databaseDump?: GoogleCloudMetastoreV2DatabaseDump; /** * Optional. The description of the metadata import. */ description?: string; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent * requests that provide a duplicate request ID for at least 60 minutes after * the first request.For example, if an initial request times out, followed by * another request with the same request ID, the server ignores the second * request to prevent the creation of duplicate commitments.The request ID * must be a valid UUID * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). A * zero UUID (00000000-0000-0000-0000-000000000000) is not supported. */ requestId?: string; } /** * The details of the latest scheduled backup. */ export interface GoogleCloudMetastoreV2LatestBackup { /** * Output only. The ID of an in-progress scheduled backup. Empty if no backup * is in progress. */ readonly backupId?: string; /** * Output only. The duration of the backup completion. */ readonly duration?: number /* Duration */; /** * Output only. The time when the backup was started. */ readonly startTime?: Date; /** * Output only. The current state of the backup. */ readonly state?: | "STATE_UNSPECIFIED" | "IN_PROGRESS" | "SUCCEEDED" | "FAILED"; } /** * Response message for DataprocMetastore.ListBackups. */ export interface GoogleCloudMetastoreV2ListBackupsResponse { /** * The backups of the specified service. */ backups?: GoogleCloudMetastoreV2Backup[]; /** * A token that can be sent as page_token to retrieve the next page. If this * field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * Locations that could not be reached. */ unreachable?: string[]; } /** * Response message for DataprocMetastore.ListServices. */ export interface GoogleCloudMetastoreV2ListServicesResponse { /** * A token that can be sent as page_token to retrieve the next page. If this * field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * The services in the specified location. */ services?: GoogleCloudMetastoreV2Service[]; /** * Locations that could not be reached. */ unreachable?: string[]; } /** * Specifies how metastore metadata should be integrated with external * services. */ export interface GoogleCloudMetastoreV2MetadataIntegration { /** * Optional. The integration config for the Data Catalog service. */ dataCatalogConfig?: GoogleCloudMetastoreV2DataCatalogConfig; } /** * Request message for DataprocMetastore.MoveTableToDatabase. */ export interface GoogleCloudMetastoreV2MoveTableToDatabaseRequest { /** * Required. The name of the database where the table resides. */ dbName?: string; /** * Required. The name of the database where the table should be moved. */ destinationDbName?: string; /** * Required. The name of the table to be moved. */ tableName?: string; } /** * Request message for DataprocMetastore.QueryMetadata. */ export interface GoogleCloudMetastoreV2QueryMetadataRequest { /** * Required. A read-only SQL query to execute against the metadata database. * The query cannot change or mutate the data. */ query?: string; } /** * Request message for DataprocMetastore.Restore. */ export interface GoogleCloudMetastoreV2RestoreServiceRequest { /** * Optional. The relative resource name of the metastore service backup to * restore from, in the following * form:projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}. * Mutually exclusive with backup_location, and exactly one of the two must be * set. */ backup?: string; /** * Optional. A Cloud Storage URI specifying the location of the backup * artifacts, namely - backup avro files under "avro/", backup_metastore.json * and service.json, in the following form:gs://. Mutually exclusive with * backup, and exactly one of the two must be set. */ backupLocation?: string; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent * requests that provide a duplicate request ID for at least 60 minutes after * the first request.For example, if an initial request times out, followed by * another request with the same request ID, the server ignores the second * request to prevent the creation of duplicate commitments.The request ID * must be a valid UUID * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). A * zero UUID (00000000-0000-0000-0000-000000000000) is not supported. */ requestId?: string; /** * Optional. The type of restore. If unspecified, defaults to METADATA_ONLY. */ restoreType?: | "RESTORE_TYPE_UNSPECIFIED" | "FULL" | "METADATA_ONLY"; } /** * Represents the scaling configuration of a metastore service. */ export interface GoogleCloudMetastoreV2ScalingConfig { /** * Optional. Scaling factor from 1 to 5, increments of 1. */ scalingFactor?: number; } /** * This specifies the configuration of scheduled backup. */ export interface GoogleCloudMetastoreV2ScheduledBackup { /** * Optional. A Cloud Storage URI of a folder, in the format gs:///. A * sub-folder containing backup files will be stored below it. */ backupLocation?: string; /** * Optional. The scheduled interval in Cron format, see * https://en.wikipedia.org/wiki/Cron The default is empty: scheduled backup * is not enabled. Must be specified to enable scheduled backups. */ cronSchedule?: string; /** * Optional. Defines whether the scheduled backup is enabled. The default * value is false. */ enabled?: boolean; /** * Output only. The details of the latest scheduled backup. */ readonly latestBackup?: GoogleCloudMetastoreV2LatestBackup; /** * Output only. The time when the next backups execution is scheduled to * start. */ readonly nextScheduledTime?: Date; /** * Optional. Specifies the time zone to be used when interpreting * cron_schedule. Must be a time zone name from the time zone database * (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), e.g. * America/Los_Angeles or Africa/Abidjan. If left unspecified, the default is * UTC. */ timeZone?: string; } /** * A managed metastore service that serves metadata queries. */ export interface GoogleCloudMetastoreV2Service { /** * Output only. The time when the metastore service was created. */ readonly createTime?: Date; /** * Immutable. Information used to configure the Dataproc Metastore service to * encrypt customer data at rest. Cannot be updated. */ encryptionConfig?: GoogleCloudMetastoreV2EncryptionConfig; /** * Output only. The list of endpoints used to access the metastore service. */ readonly endpoints?: GoogleCloudMetastoreV2Endpoint[]; /** * Configuration information specific to running Hive metastore software as * the metastore service. */ hiveMetastoreConfig?: GoogleCloudMetastoreV2HiveMetastoreConfig; /** * User-defined labels for the metastore service. */ labels?: { [key: string]: string }; /** * Optional. The setting that defines how metastore metadata should be * integrated with external services and systems. */ metadataIntegration?: GoogleCloudMetastoreV2MetadataIntegration; /** * Immutable. The relative resource name of the metastore service, in the * following * format:projects/{project_number}/locations/{location_id}/services/{service_id}. */ name?: string; /** * Optional. Scaling configuration of the metastore service. */ scalingConfig?: GoogleCloudMetastoreV2ScalingConfig; /** * Optional. The configuration of scheduled backup for the metastore service. */ scheduledBackup?: GoogleCloudMetastoreV2ScheduledBackup; /** * Output only. The current state of the metastore service. */ readonly state?: | "STATE_UNSPECIFIED" | "CREATING" | "ACTIVE" | "SUSPENDING" | "SUSPENDED" | "UPDATING" | "DELETING" | "ERROR"; /** * Output only. Additional information about the current state of the * metastore service, if available. */ readonly stateMessage?: string; /** * Output only. The globally unique resource identifier of the metastore * service. */ readonly uid?: string; /** * Output only. The time when the metastore service was last updated. */ readonly updateTime?: Date; /** * Required. A Cloud Storage URI (starting with gs://) that specifies the * default warehouse directory of the Hive Metastore. */ warehouseGcsUri?: string; } /** * This resource represents a long-running operation that is the result of a * network API call. */ export interface GoogleLongrunningOperation { /** * 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?: GoogleRpcStatus; /** * 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 }; } /** * 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 GoogleRpcStatus { /** * 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; } /** * Additional options for Metastore#projectsLocationsServicesBackupsCreate. */ export interface ProjectsLocationsServicesBackupsCreateOptions { /** * Required. The ID of the backup, which is used as the final component of * the backup's name.This value must be between 1 and 64 characters long, * begin with a letter, end with a letter or number, and consist of * alpha-numeric ASCII characters or hyphens. */ backupId?: string; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent * requests that provide a duplicate request ID for at least 60 minutes after * the first request.For example, if an initial request times out, followed by * another request with the same request ID, the server ignores the second * request to prevent the creation of duplicate commitments.The request ID * must be a valid UUID * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero * UUID (00000000-0000-0000-0000-000000000000) is not supported. */ requestId?: string; } /** * Additional options for Metastore#projectsLocationsServicesBackupsDelete. */ export interface ProjectsLocationsServicesBackupsDeleteOptions { /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent * requests that provide a duplicate request ID for at least 60 minutes after * the first request.For example, if an initial request times out, followed by * another request with the same request ID, the server ignores the second * request to prevent the creation of duplicate commitments.The request ID * must be a valid UUID * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero * UUID (00000000-0000-0000-0000-000000000000) is not supported. */ requestId?: string; } /** * Additional options for Metastore#projectsLocationsServicesBackupsList. */ export interface ProjectsLocationsServicesBackupsListOptions { /** * Optional. The filter to apply to list results. */ filter?: string; /** * Optional. Specify the ordering of results as described in Sorting Order * (https://cloud.google.com/apis/design/design_patterns#sorting_order). If * not specified, the results will be sorted in the default order. */ orderBy?: string; /** * Optional. The maximum number of backups to return. The response may * contain less than the maximum number. If unspecified, no more than 500 * backups are returned. The maximum value is 1000; values above 1000 are * changed to 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous * DataprocMetastore.ListBackups call. Provide this token to retrieve the * subsequent page.To retrieve the first page, supply an empty page token.When * paginating, other parameters provided to DataprocMetastore.ListBackups must * match the call that provided the page token. */ pageToken?: string; } /** * Additional options for Metastore#projectsLocationsServicesCreate. */ export interface ProjectsLocationsServicesCreateOptions { /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent * requests that provide a duplicate request ID for at least 60 minutes after * the first request.For example, if an initial request times out, followed by * another request with the same request ID, the server ignores the second * request to prevent the creation of duplicate commitments.The request ID * must be a valid UUID * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero * UUID (00000000-0000-0000-0000-000000000000) is not supported. */ requestId?: string; /** * Required. The ID of the metastore service, which is used as the final * component of the metastore service's name.This value must be between 2 and * 63 characters long inclusive, begin with a letter, end with a letter or * number, and consist of alpha-numeric ASCII characters or hyphens. */ serviceId?: string; } /** * Additional options for Metastore#projectsLocationsServicesDelete. */ export interface ProjectsLocationsServicesDeleteOptions { /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent * requests that provide a duplicate request ID for at least 60 minutes after * the first request.For example, if an initial request times out, followed by * another request with the same request ID, the server ignores the second * request to prevent the creation of duplicate commitments.The request ID * must be a valid UUID * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero * UUID (00000000-0000-0000-0000-000000000000) is not supported. */ requestId?: string; } /** * Additional options for Metastore#projectsLocationsServicesList. */ export interface ProjectsLocationsServicesListOptions { /** * Optional. The filter to apply to list results. */ filter?: string; /** * Optional. Specify the ordering of results as described in Sorting Order * (https://cloud.google.com/apis/design/design_patterns#sorting_order). If * not specified, the results will be sorted in the default order. */ orderBy?: string; /** * Optional. The maximum number of services to return. The response may * contain less than the maximum number. If unspecified, no more than 500 * services are returned. The maximum value is 1000; values above 1000 are * changed to 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous * DataprocMetastore.ListServices call. Provide this token to retrieve the * subsequent page.To retrieve the first page, supply an empty page token.When * paginating, other parameters provided to DataprocMetastore.ListServices * must match the call that provided the page token. */ pageToken?: string; } /** * Additional options for Metastore#projectsLocationsServicesPatch. */ export interface ProjectsLocationsServicesPatchOptions { /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent * requests that provide a duplicate request ID for at least 60 minutes after * the first request.For example, if an initial request times out, followed by * another request with the same request ID, the server ignores the second * request to prevent the creation of duplicate commitments.The request ID * must be a valid UUID * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero * UUID (00000000-0000-0000-0000-000000000000) is not supported. */ requestId?: string; /** * Required. A field mask used to specify the fields to be overwritten in the * metastore service resource by the update. Fields specified in the * update_mask are relative to the resource (not to the full request). A field * is overwritten if it is in the mask. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsServicesPatchOptions(data: any): ProjectsLocationsServicesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsServicesPatchOptions(data: any): ProjectsLocationsServicesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; }