Class ObjectsResource
The "objects" collection of methods.
Inherited Members
Namespace: Google.Apis.Storage.v1
Assembly: Google.Apis.Storage.v1.dll
Syntax
public class ObjectsResource
Constructors
ObjectsResource(IClientService)
Constructs a new resource.
Declaration
public ObjectsResource(IClientService service)
Parameters
| Type | Name | Description |
|---|---|---|
| IClientService | service |
Methods
BulkRestore(BulkRestoreObjectsRequest, string)
Initiates a long-running bulk restore operation on the specified bucket.
Declaration
public virtual ObjectsResource.BulkRestoreRequest BulkRestore(BulkRestoreObjectsRequest body, string bucket)
Parameters
| Type | Name | Description |
|---|---|---|
| BulkRestoreObjectsRequest | body | The body of the request. |
| string | bucket | Name of the bucket in which the object resides. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.BulkRestoreRequest |
Compose(ComposeRequest, string, string)
Concatenates a list of existing objects into a new object in the same bucket.
Declaration
public virtual ObjectsResource.ComposeRequest Compose(ComposeRequest body, string destinationBucket, string destinationObject)
Parameters
| Type | Name | Description |
|---|---|---|
| ComposeRequest | body | The body of the request. |
| string | destinationBucket | Name of the bucket containing the source objects. The destination object is stored in this bucket. |
| string | destinationObject | Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.ComposeRequest |
Copy(Object, string, string, string, string)
Copies a source object to a destination object. Optionally overrides metadata.
Declaration
public virtual ObjectsResource.CopyRequest Copy(Object body, string sourceBucket, string sourceObject, string destinationBucket, string destinationObject)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | body | The body of the request. |
| string | sourceBucket | Name of the bucket in which to find the source object. |
| string | sourceObject | Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
| string | destinationBucket | Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
| string | destinationObject | Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.CopyRequest |
Delete(string, string)
Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.
Declaration
public virtual ObjectsResource.DeleteRequest Delete(string bucket, string storageObject)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bucket | Name of the bucket in which the object resides. |
| string | storageObject | Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.DeleteRequest |
Get(string, string)
Retrieves an object or its metadata.
Declaration
public virtual ObjectsResource.GetRequest Get(string bucket, string storageObject)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bucket | Name of the bucket in which the object resides. |
| string | storageObject | Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.GetRequest |
GetIamPolicy(string, string)
Returns an IAM policy for the specified object.
Declaration
public virtual ObjectsResource.GetIamPolicyRequest GetIamPolicy(string bucket, string storageObject)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bucket | Name of the bucket in which the object resides. |
| string | storageObject | Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.GetIamPolicyRequest |
Insert(Object, string)
Stores a new object and metadata.
Declaration
public virtual ObjectsResource.InsertRequest Insert(Object body, string bucket)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | body | The body of the request. |
| string | bucket | Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.InsertRequest |
Insert(Object, string, Stream, string)
Stores a new object and metadata.
Declaration
public virtual ObjectsResource.InsertMediaUpload Insert(Object body, string bucket, Stream stream, string contentType)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | body | The body of the request. |
| string | bucket | Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. |
| Stream | stream | The stream to upload. See remarks for further information. |
| string | contentType | The content type of the stream to upload. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.InsertMediaUpload |
Remarks
Considerations regarding stream:
-
If
streamis seekable, then the stream position will be reset to0before reading commences. Ifstreamis not seekable, then it will be read from its current position -
Caller is responsible for maintaining the
streamopen until the upload is completed - Caller is responsible for closing the
stream
List(string)
Retrieves a list of objects matching the criteria.
Declaration
public virtual ObjectsResource.ListRequest List(string bucket)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bucket | Name of the bucket in which to look for objects. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.ListRequest |
Move(string, string, string)
Moves the source object to the destination object in the same bucket.
Declaration
public virtual ObjectsResource.MoveRequest Move(string bucket, string sourceObject, string destinationObject)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bucket | Name of the bucket in which the object resides. |
| string | sourceObject | Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
| string | destinationObject | Name of the destination object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.MoveRequest |
Patch(Object, string, string)
Patches an object's metadata.
Declaration
public virtual ObjectsResource.PatchRequest Patch(Object body, string bucket, string storageObject)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | body | The body of the request. |
| string | bucket | Name of the bucket in which the object resides. |
| string | storageObject | Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.PatchRequest |
Restore(string, string, long)
Restores a soft-deleted object.
Declaration
public virtual ObjectsResource.RestoreRequest Restore(string bucket, string storageObject, long generation)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bucket | Name of the bucket in which the object resides. |
| string | storageObject | Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
| long | generation | Selects a specific revision of this object. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.RestoreRequest |
Rewrite(Object, string, string, string, string)
Rewrites a source object to a destination object. Optionally overrides metadata.
Declaration
public virtual ObjectsResource.RewriteRequest Rewrite(Object body, string sourceBucket, string sourceObject, string destinationBucket, string destinationObject)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | body | The body of the request. |
| string | sourceBucket | Name of the bucket in which to find the source object. |
| string | sourceObject | Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
| string | destinationBucket | Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. |
| string | destinationObject | Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.RewriteRequest |
SetIamPolicy(Policy, string, string)
Updates an IAM policy for the specified object.
Declaration
public virtual ObjectsResource.SetIamPolicyRequest SetIamPolicy(Policy body, string bucket, string storageObject)
Parameters
| Type | Name | Description |
|---|---|---|
| Policy | body | The body of the request. |
| string | bucket | Name of the bucket in which the object resides. |
| string | storageObject | Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.SetIamPolicyRequest |
TestIamPermissions(string, string, Repeatable<string>)
Tests a set of permissions on the given object to see which, if any, are held by the caller.
Declaration
public virtual ObjectsResource.TestIamPermissionsRequest TestIamPermissions(string bucket, string storageObject, Repeatable<string> permissions)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bucket | Name of the bucket in which the object resides. |
| string | storageObject | Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
| Repeatable<string> | permissions | Permissions to test. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.TestIamPermissionsRequest |
Update(Object, string, string)
Updates an object's metadata.
Declaration
public virtual ObjectsResource.UpdateRequest Update(Object body, string bucket, string storageObject)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | body | The body of the request. |
| string | bucket | Name of the bucket in which the object resides. |
| string | storageObject | Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.UpdateRequest |
WatchAll(Channel, string)
Watch for changes on all objects in a bucket.
Declaration
public virtual ObjectsResource.WatchAllRequest WatchAll(Channel body, string bucket)
Parameters
| Type | Name | Description |
|---|---|---|
| Channel | body | The body of the request. |
| string | bucket | Name of the bucket in which to look for objects. |
Returns
| Type | Description |
|---|---|
| ObjectsResource.WatchAllRequest |