@@ -1025,7 +1025,7 @@ File.prototype.getSignedPolicy = function(options, callback) {
1025
1025
* @param {string= } options.responseDisposition - The
1026
1026
* response-content-disposition parameter (http://goo.gl/yMWxQV) of the
1027
1027
* signed url.
1028
- * @param {string= } options.responseType - The response-content-type parameter
1028
+ * @param {string= } options.responseType - The response-content-type parameter
1029
1029
* of the signed url.
1030
1030
* @param {function= } callback - The callback function.
1031
1031
*
@@ -1071,20 +1071,20 @@ File.prototype.getSignedUrl = function(options, callback) {
1071
1071
1072
1072
var responseContentType = '' ;
1073
1073
if ( util . is ( options . responseType , 'string' ) ) {
1074
- responseContentType =
1075
- '&response-content-type=' +
1074
+ responseContentType =
1075
+ '&response-content-type=' +
1076
1076
encodeURIComponent ( options . responseType ) ;
1077
1077
}
1078
1078
1079
1079
var responseContentDisposition = '' ;
1080
1080
if ( util . is ( options . promptSaveAs , 'string' ) ) {
1081
1081
responseContentDisposition =
1082
- '&response-content-disposition=attachment; filename="' +
1082
+ '&response-content-disposition=attachment; filename="' +
1083
1083
encodeURIComponent ( options . promptSaveAs ) + '"' ;
1084
1084
}
1085
1085
if ( util . is ( options . responseDisposition , 'string' ) ) {
1086
- responseContentDisposition =
1087
- '&response-content-disposition=' +
1086
+ responseContentDisposition =
1087
+ '&response-content-disposition=' +
1088
1088
encodeURIComponent ( options . responseDisposition ) ;
1089
1089
}
1090
1090
@@ -1100,9 +1100,17 @@ File.prototype.getSignedUrl = function(options, callback) {
1100
1100
} ;
1101
1101
1102
1102
/**
1103
- * Set the file's metadata.
1103
+ * Merge the given metadata with the current remote file's metadata. This will
1104
+ * set metadata if it was previously unset or update previously set metadata. To
1105
+ * unset previously set metadata, set its value to null.
1106
+ *
1107
+ * You can set custom key/value pairs in the metadata key of the given object,
1108
+ * however the other properties outside of this object must adhere to the
1109
+ * [official API documentation](https://goo.gl/BOnnCK).
1104
1110
*
1105
- * @param {object } metadata - The metadata you wish to set.
1111
+ * See the examples below for more information.
1112
+ *
1113
+ * @param {object } metadata - The metadata you wish to update.
1106
1114
* @param {function= } callback - The callback function.
1107
1115
*
1108
1116
* @example
@@ -1113,6 +1121,17 @@ File.prototype.getSignedUrl = function(options, callback) {
1113
1121
* properties: 'go here'
1114
1122
* }
1115
1123
* }, function(err, metadata, apiResponse) {});
1124
+ *
1125
+ * // Assuming current metadata = { hello: 'world', unsetMe: 'will do' }
1126
+ * file.setMetadata({
1127
+ * metadata: {
1128
+ * abc: '123', // will be set.
1129
+ * unsetMe: null, // will be unset (deleted).
1130
+ * hello: 'goodbye' // will be updated from 'hello' to 'goodbye'.
1131
+ * }
1132
+ * }, function(err, metadata, apiResponse) {
1133
+ * // metadata should now be { abc: '123', hello: 'goodbye' }
1134
+ * });
1116
1135
*/
1117
1136
File . prototype . setMetadata = function ( metadata , callback ) {
1118
1137
callback = callback || util . noop ;
0 commit comments