UNPKG

2.67 kBTypeScriptView Raw
1/*!
2 * Copyright 2019 Google Inc. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16import * as common from '@google-cloud/common';
17import { BigQuery, Job, Dataset, ResourceCallback, RequestCallback, JobRequest } from '.';
18import { JobMetadata } from './job';
19import bigquery from './types';
20export interface File {
21 bucket: any;
22 kmsKeyName?: string;
23 userProject?: string;
24 name: string;
25 generation?: number;
26}
27export declare type JobMetadataCallback = RequestCallback<JobMetadata>;
28export declare type JobMetadataResponse = [JobMetadata];
29export declare type JobResponse = [Job, bigquery.IJob];
30export declare type JobCallback = ResourceCallback<Job, bigquery.IJob>;
31export declare type CreateExtractJobOptions = JobRequest<bigquery.IJobConfigurationExtract> & {
32 format?: 'ML_TF_SAVED_MODEL' | 'ML_XGBOOST_BOOSTER';
33};
34/**
35 * Model objects are returned by methods such as {@link Dataset#model} and
36 * {@link Dataset#getModels}.
37 *
38 * @class
39 * @param {Dataset} dataset {@link Dataset} instance.
40 * @param {string} id The ID of the model.
41 *
42 * @example
43 * const {BigQuery} = require('@google-cloud/bigquery');
44 * const bigquery = new BigQuery();
45 * const dataset = bigquery.dataset('my-dataset');
46 *
47 * const model = dataset.model('my-model');
48 */
49declare class Model extends common.ServiceObject {
50 dataset: Dataset;
51 bigQuery: BigQuery;
52 constructor(dataset: Dataset, id: string);
53 createExtractJob(destination: string | File, options?: CreateExtractJobOptions): Promise<JobResponse>;
54 createExtractJob(destination: string | File, options: CreateExtractJobOptions, callback: JobCallback): void;
55 createExtractJob(destination: string | File, callback: JobCallback): void;
56 extract(destination: string | File, options?: CreateExtractJobOptions): Promise<JobMetadataResponse>;
57 extract(destination: string | File, options: CreateExtractJobOptions, callback?: JobMetadataCallback): void;
58 extract(destination: string | File, callback?: JobMetadataCallback): void;
59}
60/**
61 * Reference to the {@link Model} class.
62 * @name module:@google-cloud/bigquery.Model
63 * @see Model
64 */
65export { Model };