Skip to content

Commit

Permalink
docs: modernize usage of storage classes (#862)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus authored and JesseLovelace committed Sep 24, 2019
1 parent 91d8cea commit 455ba0a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2767,7 +2767,7 @@ class Bucket extends ServiceObject {
* const storage = new Storage();
* const bucket = storage.bucket('albums');
*
* bucket.setStorageClass('regional', function(err, apiResponse) {
* bucket.setStorageClass('nearline', function(err, apiResponse) {
* if (err) {
* // Error handling omitted.
* }
Expand All @@ -2778,7 +2778,7 @@ class Bucket extends ServiceObject {
* //-
* // If the callback is omitted, we'll return a Promise.
* //-
* bucket.setStorageClass('regional').then(function() {});
* bucket.setStorageClass('nearline').then(function() {});
*/
setStorageClass(
storageClass: string,
Expand Down
10 changes: 6 additions & 4 deletions src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3218,16 +3218,18 @@ class File extends ServiceObject<File> {
* @see [Per-Object Storage Class]{@link https://cloud.google.com/storage/docs/per-object-storage-class}
* @see [Storage Classes]{@link https://cloud.google.com/storage/docs/storage-classes}
*
* @param {string} storageClass The new storage class. (`multi_regional`,
* `regional`, `nearline`, `coldline`)
* @param {string} storageClass The new storage class. (`standard`,
* `nearline`, or `coldline`)
* **Note:** The storage classes `multi_regional` and `regional`
* are now legacy and will be deprecated in the future.
* @param {SetStorageClassOptions} [options] Configuration options.
* @param {string} [options.userProject] The ID of the project which will be
* billed for the request.
* @param {SetStorageClassCallback} [callback] Callback function.
* @returns {Promise<SetStorageClassResponse>}
*
* @example
* file.setStorageClass('regional', function(err, apiResponse) {
* file.setStorageClass('nearline', function(err, apiResponse) {
* if (err) {
* // Error handling omitted.
* }
Expand All @@ -3238,7 +3240,7 @@ class File extends ServiceObject<File> {
* //-
* // If the callback is omitted, we'll return a Promise.
* //-
* file.setStorageClass('regional').then(function() {});
* file.setStorageClass('nearline').then(function() {});
*/
setStorageClass(
storageClass: string,
Expand Down
4 changes: 2 additions & 2 deletions system-test/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -954,9 +954,9 @@ describe('storage', () => {
await bucket.create();
let [metadata] = await bucket.getMetadata();
assert.strictEqual(metadata.storageClass, 'STANDARD');
await bucket.setStorageClass('multi-regional');
await bucket.setStorageClass('coldline');
[metadata] = await bucket.getMetadata();
assert.strictEqual(metadata.storageClass, 'MULTI_REGIONAL');
assert.strictEqual(metadata.storageClass, 'COLDLINE');
});

describe('locationType', () => {
Expand Down

0 comments on commit 455ba0a

Please sign in to comment.