Skip to content

Commit

Permalink
Fix the requesterPays methods (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Sep 19, 2018
1 parent 49be5b6 commit e148fa6
Showing 1 changed file with 24 additions and 24 deletions.
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

0 comments on commit e148fa6

Please sign in to comment.