Class MediaResource
The "media" collection of methods.
Inherited Members
Namespace: Google.Apis.DisplayVideo.v2
Assembly: Google.Apis.DisplayVideo.v2.dll
Syntax
public class MediaResource
Constructors
MediaResource(IClientService)
Constructs a new resource.
Declaration
public MediaResource(IClientService service)
Parameters
Type | Name | Description |
---|---|---|
IClientService | service |
Methods
Download(string)
Downloads media. Download is supported on the URI /download/{resource_name=**}?alt=media.
Note:
Download requests will not be successful without including alt=media
query string.
Declaration
public virtual MediaResource.DownloadRequest Download(string resourceName)
Parameters
Type | Name | Description |
---|---|---|
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/media/{resource_name=**}?upload_type=media.
Note: Upload requests will not be successful without including upload_type=media
query string.
Declaration
public virtual MediaResource.UploadRequest Upload(GoogleBytestreamMedia body, string resourceName)
Parameters
Type | Name | Description |
---|---|---|
GoogleBytestreamMedia | body | The body of the request. |
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/media/{resource_name=**}?upload_type=media.
Note: Upload requests will not be successful without including upload_type=media
query string.
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. |
string | resourceName | Name of the media that is being downloaded. See ReadRequest.resource_name. |
Stream | stream | The stream to upload. See remarks for further information. |
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