Files
old-slucajna-televizija/backend/node_modules/googleapis/apis/storagetransfer/v1.js
GotPPay a75ea978f9 ..
2017-10-16 20:21:19 +02:00

1009 lines
44 KiB
JavaScript

"use strict";
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* jshint maxlen: false */
const apirequest_1 = require("../../lib/apirequest");
/**
* Google Storage Transfer API
*
* Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets.
*
* @example
* const google = require('googleapis');
* const storagetransfer = google.storagetransfer('v1');
*
* @namespace storagetransfer
* @type {Function}
* @version v1
* @variation v1
* @param {object=} options Options for Storagetransfer
*/
function Storagetransfer(options) {
const self = this;
self._options = options || {};
self.googleServiceAccounts = {
/**
* storagetransfer.googleServiceAccounts.get
*
* @desc Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud Platform Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Google Storage Transfer API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/storagetransfer
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var storagetransfer = google.storagetransfer('v1');
*
* authorize(function(authClient) {
* var request = {
* // The ID of the Google Cloud Platform Console project that the Google service
* // account is associated with.
* // Required.
* projectId: 'my-project-id', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* storagetransfer.googleServiceAccounts.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias storagetransfer.googleServiceAccounts.get
* @memberOf! storagetransfer(v1)
*
* @param {object} params Parameters for request
* @param {string} params.projectId The ID of the Google Cloud Platform Console project that the Google service account is associated with. Required.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://storagetransfer.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/v1/googleServiceAccounts/{projectId}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['projectId'],
pathParams: ['projectId'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.transferJobs = {
/**
* storagetransfer.transferJobs.create
*
* @desc Creates a transfer job that runs periodically.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Google Storage Transfer API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/storagetransfer
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var storagetransfer = google.storagetransfer('v1');
*
* authorize(function(authClient) {
* var request = {
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* storagetransfer.transferJobs.create(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias storagetransfer.transferJobs.create
* @memberOf! storagetransfer(v1)
*
* @param {object} params Parameters for request
* @param {storagetransfer(v1).TransferJob} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
create: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://storagetransfer.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/v1/transferJobs').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: [],
pathParams: [],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* storagetransfer.transferJobs.get
*
* @desc Gets a transfer job.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Google Storage Transfer API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/storagetransfer
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var storagetransfer = google.storagetransfer('v1');
*
* authorize(function(authClient) {
* var request = {
* // The job to get.
* // Required.
* jobName: 'transferJobs/my-transfer-job', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* storagetransfer.transferJobs.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias storagetransfer.transferJobs.get
* @memberOf! storagetransfer(v1)
*
* @param {object} params Parameters for request
* @param {string} params.jobName The job to get. Required.
* @param {string=} params.projectId The ID of the Google Cloud Platform Console project that owns the job. Required.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://storagetransfer.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/v1/{jobName}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['jobName'],
pathParams: ['jobName'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* storagetransfer.transferJobs.list
*
* @desc Lists transfer jobs.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Google Storage Transfer API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/storagetransfer
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var storagetransfer = google.storagetransfer('v1');
*
* authorize(function(authClient) {
* var request = {
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var transferJobsPage = response['transferJobs'];
* if (!transferJobsPage) {
* return;
* }
* for (var i = 0; i < transferJobsPage.length; i++) {
* // TODO: Change code below to process each resource in `transferJobsPage`:
* console.log(JSON.stringify(transferJobsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* storagetransfer.transferJobs.list(request, handlePage);
* }
* };
*
* storagetransfer.transferJobs.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias storagetransfer.transferJobs.list
* @memberOf! storagetransfer(v1)
*
* @param {object} params Parameters for request
* @param {string=} params.filter A list of query parameters specified as JSON text in the form of {"project_id":"my_project_id", "job_names":["jobid1","jobid2",...], "job_statuses":["status1","status2",...]}. Since `job_names` and `job_statuses` support multiple values, their values must be specified with array notation. `project_id` is required. `job_names` and `job_statuses` are optional. The valid values for `job_statuses` are case-insensitive: `ENABLED`, `DISABLED`, and `DELETED`.
* @param {integer=} params.pageSize The list page size. The max allowed value is 256.
* @param {string=} params.pageToken The list page token.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://storagetransfer.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/v1/transferJobs').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: [],
pathParams: [],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* storagetransfer.transferJobs.patch
*
* @desc Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already. Updating the scheduling of a job is not allowed.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Google Storage Transfer API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/storagetransfer
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var storagetransfer = google.storagetransfer('v1');
*
* authorize(function(authClient) {
* var request = {
* // The name of job to update.
* // Required.
* jobName: 'transferJobs/my-transfer-job', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* storagetransfer.transferJobs.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias storagetransfer.transferJobs.patch
* @memberOf! storagetransfer(v1)
*
* @param {object} params Parameters for request
* @param {string} params.jobName The name of job to update. Required.
* @param {storagetransfer(v1).UpdateTransferJobRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://storagetransfer.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/v1/{jobName}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['jobName'],
pathParams: ['jobName'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.transferOperations = {
/**
* storagetransfer.transferOperations.cancel
*
* @desc Cancels a transfer. Use the get method to check whether the cancellation succeeded or whether the operation completed despite cancellation.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Google Storage Transfer API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/storagetransfer
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var storagetransfer = google.storagetransfer('v1');
*
* authorize(function(authClient) {
* var request = {
* // The name of the operation resource to be cancelled.
* name: 'transferOperations/my-transfer-operation', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* storagetransfer.transferOperations.cancel(request, function(err) {
* if (err) {
* console.error(err);
* return;
* }
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias storagetransfer.transferOperations.cancel
* @memberOf! storagetransfer(v1)
*
* @param {object} params Parameters for request
* @param {string} params.name The name of the operation resource to be cancelled.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
cancel: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://storagetransfer.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/v1/{name}:cancel').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['name'],
pathParams: ['name'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* storagetransfer.transferOperations.delete
*
* @desc This method is not supported and the server returns `UNIMPLEMENTED`.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Google Storage Transfer API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/storagetransfer
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var storagetransfer = google.storagetransfer('v1');
*
* authorize(function(authClient) {
* var request = {
* // The name of the operation resource to be deleted.
* name: 'transferOperations/my-transfer-operation', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* storagetransfer.transferOperations.delete(request, function(err) {
* if (err) {
* console.error(err);
* return;
* }
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias storagetransfer.transferOperations.delete
* @memberOf! storagetransfer(v1)
*
* @param {object} params Parameters for request
* @param {string} params.name The name of the operation resource to be deleted.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://storagetransfer.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['name'],
pathParams: ['name'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* storagetransfer.transferOperations.get
*
* @desc Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Google Storage Transfer API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/storagetransfer
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var storagetransfer = google.storagetransfer('v1');
*
* authorize(function(authClient) {
* var request = {
* // The name of the operation resource.
* name: 'transferOperations/my-transfer-operation', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* storagetransfer.transferOperations.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias storagetransfer.transferOperations.get
* @memberOf! storagetransfer(v1)
*
* @param {object} params Parameters for request
* @param {string} params.name The name of the operation resource.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://storagetransfer.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['name'],
pathParams: ['name'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* storagetransfer.transferOperations.list
*
* @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Google Storage Transfer API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/storagetransfer
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var storagetransfer = google.storagetransfer('v1');
*
* authorize(function(authClient) {
* var request = {
* // The value `transferOperations`.
* name: 'transferOperations', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var operationsPage = response['operations'];
* if (!operationsPage) {
* return;
* }
* for (var i = 0; i < operationsPage.length; i++) {
* // TODO: Change code below to process each resource in `operationsPage`:
* console.log(JSON.stringify(operationsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* storagetransfer.transferOperations.list(request, handlePage);
* }
* };
*
* storagetransfer.transferOperations.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias storagetransfer.transferOperations.list
* @memberOf! storagetransfer(v1)
*
* @param {object} params Parameters for request
* @param {string=} params.filter A list of query parameters specified as JSON text in the form of {\"project_id\" : \"my_project_id\", \"job_names\" : [\"jobid1\", \"jobid2\",...], \"operation_names\" : [\"opid1\", \"opid2\",...], \"transfer_statuses\":[\"status1\", \"status2\",...]}. Since `job_names`, `operation_names`, and `transfer_statuses` support multiple values, they must be specified with array notation. `job_names`, `operation_names`, and `transfer_statuses` are optional.
* @param {string} params.name The value `transferOperations`.
* @param {integer=} params.pageSize The list page size. The max allowed value is 256.
* @param {string=} params.pageToken The list page token.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://storagetransfer.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['name'],
pathParams: ['name'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* storagetransfer.transferOperations.pause
*
* @desc Pauses a transfer operation.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Google Storage Transfer API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/storagetransfer
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var storagetransfer = google.storagetransfer('v1');
*
* authorize(function(authClient) {
* var request = {
* // The name of the transfer operation.
* // Required.
* name: 'transferOperations/my-transfer-operation', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* storagetransfer.transferOperations.pause(request, function(err) {
* if (err) {
* console.error(err);
* return;
* }
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias storagetransfer.transferOperations.pause
* @memberOf! storagetransfer(v1)
*
* @param {object} params Parameters for request
* @param {string} params.name The name of the transfer operation. Required.
* @param {storagetransfer(v1).PauseTransferOperationRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
pause: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://storagetransfer.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/v1/{name}:pause').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['name'],
pathParams: ['name'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* storagetransfer.transferOperations.resume
*
* @desc Resumes a transfer operation that is paused.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Google Storage Transfer API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/storagetransfer
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var storagetransfer = google.storagetransfer('v1');
*
* authorize(function(authClient) {
* var request = {
* // The name of the transfer operation.
* // Required.
* name: 'transferOperations/my-transfer-operation', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* storagetransfer.transferOperations.resume(request, function(err) {
* if (err) {
* console.error(err);
* return;
* }
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias storagetransfer.transferOperations.resume
* @memberOf! storagetransfer(v1)
*
* @param {object} params Parameters for request
* @param {string} params.name The name of the transfer operation. Required.
* @param {storagetransfer(v1).ResumeTransferOperationRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
resume: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://storagetransfer.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/v1/{name}:resume').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['name'],
pathParams: ['name'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
}
module.exports = Storagetransfer;
//# sourceMappingURL=v1.js.map