move method
- String bucket,
- String sourceObject,
- String destinationObject, {
- String? ifGenerationMatch,
- String? ifGenerationNotMatch,
- String? ifMetagenerationMatch,
- String? ifMetagenerationNotMatch,
- String? ifSourceGenerationMatch,
- String? ifSourceGenerationNotMatch,
- String? ifSourceMetagenerationMatch,
- String? ifSourceMetagenerationNotMatch,
- String? projection,
- String? userProject,
- String? $fields,
Moves the source object to the destination object in the same bucket.
Request parameters:
bucket - Name of the bucket in which the object resides.
sourceObject - Name of the source object. For information about how to
URL encode object names to be path safe, see
Encoding URI Path Parts.
destinationObject - Name of the destination object. For information
about how to URL encode object names to be path safe, see
Encoding URI Path Parts.
ifGenerationMatch - Makes the operation conditional on whether the
destination object's current generation matches the given value. Setting
to 0 makes the operation succeed only if there are no live versions of the
object. ifGenerationMatch and ifGenerationNotMatch conditions are
mutually exclusive: it's an error for both of them to be set in the
request.
ifGenerationNotMatch - Makes the operation conditional on whether the
destination object's current generation does not match the given value. If
no live object exists, the precondition fails. Setting to 0 makes the
operation succeed only if there is a live version of the
object.ifGenerationMatch and ifGenerationNotMatch conditions are
mutually exclusive: it's an error for both of them to be set in the
request.
ifMetagenerationMatch - Makes the operation conditional on whether the
destination object's current metageneration matches the given value.
ifMetagenerationMatch and ifMetagenerationNotMatch conditions are
mutually exclusive: it's an error for both of them to be set in the
request.
ifMetagenerationNotMatch - Makes the operation conditional on whether
the destination object's current metageneration does not match the given
value. ifMetagenerationMatch and ifMetagenerationNotMatch conditions
are mutually exclusive: it's an error for both of them to be set in the
request.
ifSourceGenerationMatch - Makes the operation conditional on whether the
source object's current generation matches the given value.
ifSourceGenerationMatch and ifSourceGenerationNotMatch conditions are
mutually exclusive: it's an error for both of them to be set in the
request.
ifSourceGenerationNotMatch - Makes the operation conditional on whether
the source object's current generation does not match the given value.
ifSourceGenerationMatch and ifSourceGenerationNotMatch conditions are
mutually exclusive: it's an error for both of them to be set in the
request.
ifSourceMetagenerationMatch - Makes the operation conditional on whether
the source object's current metageneration matches the given value.
ifSourceMetagenerationMatch and ifSourceMetagenerationNotMatch
conditions are mutually exclusive: it's an error for both of them to be
set in the request.
ifSourceMetagenerationNotMatch - Makes the operation conditional on
whether the source object's current metageneration does not match the
given value. ifSourceMetagenerationMatch and
ifSourceMetagenerationNotMatch conditions are mutually exclusive: it's
an error for both of them to be set in the request.
projection - Set of properties to return. Defaults to noAcl.
Possible string values are:
- "full" : Include all properties.
- "noAcl" : Omit the owner, acl property.
userProject - The project to be billed for this request. Required for
Requester Pays buckets.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a Object.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<Object> move(
core.String bucket,
core.String sourceObject,
core.String destinationObject, {
core.String? ifGenerationMatch,
core.String? ifGenerationNotMatch,
core.String? ifMetagenerationMatch,
core.String? ifMetagenerationNotMatch,
core.String? ifSourceGenerationMatch,
core.String? ifSourceGenerationNotMatch,
core.String? ifSourceMetagenerationMatch,
core.String? ifSourceMetagenerationNotMatch,
core.String? projection,
core.String? userProject,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'ifGenerationMatch': ?ifGenerationMatch == null
? null
: [ifGenerationMatch],
'ifGenerationNotMatch': ?ifGenerationNotMatch == null
? null
: [ifGenerationNotMatch],
'ifMetagenerationMatch': ?ifMetagenerationMatch == null
? null
: [ifMetagenerationMatch],
'ifMetagenerationNotMatch': ?ifMetagenerationNotMatch == null
? null
: [ifMetagenerationNotMatch],
'ifSourceGenerationMatch': ?ifSourceGenerationMatch == null
? null
: [ifSourceGenerationMatch],
'ifSourceGenerationNotMatch': ?ifSourceGenerationNotMatch == null
? null
: [ifSourceGenerationNotMatch],
'ifSourceMetagenerationMatch': ?ifSourceMetagenerationMatch == null
? null
: [ifSourceMetagenerationMatch],
'ifSourceMetagenerationNotMatch': ?ifSourceMetagenerationNotMatch == null
? null
: [ifSourceMetagenerationNotMatch],
'projection': ?projection == null ? null : [projection],
'userProject': ?userProject == null ? null : [userProject],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'b/' +
commons.escapeVariable('$bucket') +
'/o/' +
commons.escapeVariable('$sourceObject') +
'/moveTo/o/' +
commons.escapeVariable('$destinationObject');
final response_ = await _requester.request(
url_,
'POST',
queryParams: queryParams_,
);
return Object.fromJson(response_ as core.Map<core.String, core.dynamic>);
}