Class MediaResource
The "media" collection of methods.
Inheritance
System.Object
MediaResource
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Google.Apis.RemoteBuildExecution.v1
Assembly: Google.Apis.RemoteBuildExecution.v1.dll
Syntax
public class MediaResource
Constructors
MediaResource(IClientService)
Constructs a new resource.
Declaration
public MediaResource(IClientService service)
Parameters
Type | Name | Description |
---|---|---|
Google.Apis.Services.IClientService | service |
Methods
Download(String)
Downloads media. Download is supported on the URI /v1/media/{+name}?alt=media
.
Declaration
public virtual MediaResource.DownloadRequest Download(string resourceName)
Parameters
Type | Name | Description |
---|---|---|
System.String | resourceName | Name of the media that is being downloaded. See ReadRequest.resource_name. |
Returns
Type | Description |
---|---|
MediaResource.DownloadRequest |
Upload(GoogleBytestreamMedia, String)
Uploads media. Upload is supported on the URI /upload/v1/media/{+name}
.
Declaration
public virtual MediaResource.UploadRequest Upload(GoogleBytestreamMedia body, string resourceName)
Parameters
Type | Name | Description |
---|---|---|
GoogleBytestreamMedia | body | The body of the request. |
System.String | resourceName | Name of the media that is being downloaded. See ReadRequest.resource_name. |
Returns
Type | Description |
---|---|
MediaResource.UploadRequest |
Upload(GoogleBytestreamMedia, String, Stream, String)
Uploads media. Upload is supported on the URI /upload/v1/media/{+name}
.
Declaration
public virtual MediaResource.UploadMediaUpload Upload(GoogleBytestreamMedia body, string resourceName, Stream stream, string contentType)
Parameters
Type | Name | Description |
---|---|---|
GoogleBytestreamMedia | body | The body of the request. |
System.String | resourceName | Name of the media that is being downloaded. See ReadRequest.resource_name. |
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 |
---|---|
MediaResource.UploadMediaUpload |
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