Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the requesterPays methods #400

Merged
merged 1 commit into from
Sep 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions src/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,32 +284,32 @@ export interface DeleteLabelsCallback {
}

/**
* @typedef {array} DisableOptionserPaysResponse
* @typedef {array} DisableRequesterPaysResponse
* @property {object} 0 The full API response.
*/
export type DisableOptionserPaysResponse = [request.Response];
export type DisableRequesterPaysResponse = [request.Response];

/**
* @callback DisableOptionserPaysCallback
* @callback DisableRequesterPaysCallback
* @param {?Error} err Request error, if any.
* @param {object} apiResponse The full API response.
*/
export interface DisableOptionserPaysCallback {
export interface DisableRequesterPaysCallback {
(err: Error|null, apiResponse?: object);
}

/**
* @typedef {array} EnableOptionserPaysResponse
* @typedef {array} EnableRequesterPaysResponse
* @property {object} 0 The full API response.
*/
export type EnableOptionserPaysResponse = [request.Response];
export type EnableRequesterPaysResponse = [request.Response];

/**
* @callback EnableOptionserPaysCallback
* @callback EnableRequesterPaysCallback
* @param {?Error} err Request error, if any.
* @param {object} apiResponse The full API response.
*/
export interface EnableOptionserPaysCallback {
export interface EnableRequesterPaysCallback {
(err: Error|null, apiResponse: request.Response);
}

Expand Down Expand Up @@ -1296,15 +1296,15 @@ class Bucket extends ServiceObject {
*
* Disable `requesterPays` functionality from this bucket.
*
* @param {DisableOptionserPaysCallback} [callback] Callback function.
* @returns {Promise<DisableOptionserPaysCallback>}
* @param {DisableRequesterPaysCallback} [callback] Callback function.
* @returns {Promise<DisableRequesterPaysCallback>}
*
* @example
* const {Storage} = require('@google-cloud/storage');
* const storage = new Storage();
* const bucket = storage.bucket('albums');
*
* bucket.disableOptionserPays(function(err, apiResponse) {
* bucket.disableRequesterPays(function(err, apiResponse) {
* if (!err) {
* // requesterPays functionality disabled successfully.
* }
Expand All @@ -1313,18 +1313,18 @@ class Bucket extends ServiceObject {
* //-
* // If the callback is omitted, we'll return a Promise.
* //-
* bucket.disableOptionserPays().then(function(data) {
* bucket.disableRequesterPays().then(function(data) {
* const apiResponse = data[0];
* });
*
* @example <caption>include:samples/requesterPays.js</caption>
* region_tag:storage_disable_requester_pays
* Example of disabling requester pays:
*/
disableOptionserPays(): Promise<DisableOptionserPaysResponse>;
disableOptionserPays(callback: DisableOptionserPaysCallback): void;
disableOptionserPays(callback?: DisableOptionserPaysCallback):
Promise<DisableOptionserPaysResponse>|void {
disableRequesterPays(): Promise<DisableRequesterPaysResponse>;
disableRequesterPays(callback: DisableRequesterPaysCallback): void;
disableRequesterPays(callback?: DisableRequesterPaysCallback):
Promise<DisableRequesterPaysResponse>|void {
this.setMetadata(
{
billing: {
Expand All @@ -1346,15 +1346,15 @@ class Bucket extends ServiceObject {
* bucket owner, to have the requesting user assume the charges for the access
* to your bucket and its contents.
*
* @param {EnableOptionserPaysCallback} [callback] Callback function.
* @returns {Promise<EnableOptionserPaysResponse>}
* @param {EnableRequesterPaysCallback} [callback] Callback function.
* @returns {Promise<EnableRequesterPaysResponse>}
*
* @example
* const {Storage} = require('@google-cloud/storage');
* const storage = new Storage();
* const bucket = storage.bucket('albums');
*
* bucket.enableOptionserPays(function(err, apiResponse) {
* bucket.enableRequesterPays(function(err, apiResponse) {
* if (!err) {
* // requesterPays functionality enabled successfully.
* }
Expand All @@ -1363,18 +1363,18 @@ class Bucket extends ServiceObject {
* //-
* // If the callback is omitted, we'll return a Promise.
* //-
* bucket.enableOptionserPays().then(function(data) {
* bucket.enableRequesterPays().then(function(data) {
* const apiResponse = data[0];
* });
*
* @example <caption>include:samples/requesterPays.js</caption>
* region_tag:storage_enable_requester_pays
* Example of enabling requester pays:
*/
enableOptionserPays(): Promise<EnableOptionserPaysResponse>;
enableOptionserPays(callback: EnableOptionserPaysCallback): void;
enableOptionserPays(callback?: EnableOptionserPaysCallback):
Promise<EnableOptionserPaysResponse>|void {
enableRequesterPays(): Promise<EnableRequesterPaysResponse>;
enableRequesterPays(callback: EnableRequesterPaysCallback): void;
enableRequesterPays(callback?: EnableRequesterPaysCallback):
Promise<EnableRequesterPaysResponse>|void {
this.setMetadata(
{
billing: {
Expand Down