Class ObjectsResource
The "objects" collection of methods.
Inheritance
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
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. |
System.String | destinationBucket | Name of the bucket containing the source objects. The destination object is stored in this bucket. |
System.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. |
System.String | sourceBucket | Name of the bucket in which to find the source object. |
System.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. |
System.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. |
System.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 |
---|---|---|
System.String | bucket | Name of the bucket in which the object resides. |
System.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 |
---|---|---|
System.String | bucket | Name of the bucket in which the object resides. |
System.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 |
---|---|---|
System.String | bucket | Name of the bucket in which the object resides. |
System.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. |
System.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. |
System.String | bucket | Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. |
System.IO.Stream | stream | The stream to upload. See remarks for further information. |
System.String | contentType | The content type of the stream to upload. |
Returns
Type | Description |
---|---|
ObjectsResource.InsertMediaUpload |
Remarks
Considerations regarding stream
:
-
If
stream
is seekable, then the stream position will be reset to0
before reading commences. Ifstream
is not seekable, then it will be read from its current position -
Caller is responsible for maintaining the
stream
open 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 |
---|---|---|
System.String | bucket | Name of the bucket in which to look for objects. |
Returns
Type | Description |
---|---|
ObjectsResource.ListRequest |
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. |
System.String | bucket | Name of the bucket in which the object resides. |
System.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 |
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. |
System.String | sourceBucket | Name of the bucket in which to find the source object. |
System.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. |
System.String | destinationBucket | Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. |
System.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. |
System.String | bucket | Name of the bucket in which the object resides. |
System.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 |
---|---|---|
System.String | bucket | Name of the bucket in which the object resides. |
System.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<System.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. |
System.String | bucket | Name of the bucket in which the object resides. |
System.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. |
System.String | bucket | Name of the bucket in which to look for objects. |
Returns
Type | Description |
---|---|
ObjectsResource.WatchAllRequest |