Show / Hide Table of Contents

Class MediaResource.DownloadRequest

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.

Inheritance
System.Object
Google.Apis.Requests.ClientServiceRequest
Google.Apis.Requests.ClientServiceRequest<GoogleBytestreamMedia>
DisplayVideoBaseServiceRequest<GoogleBytestreamMedia>
MediaResource.DownloadRequest
Implements
Google.Apis.Requests.IClientServiceRequest<GoogleBytestreamMedia>
Google.Apis.Requests.IClientServiceRequest
Inherited Members
DisplayVideoBaseServiceRequest<GoogleBytestreamMedia>.Xgafv
DisplayVideoBaseServiceRequest<GoogleBytestreamMedia>.AccessToken
DisplayVideoBaseServiceRequest<GoogleBytestreamMedia>.Alt
DisplayVideoBaseServiceRequest<GoogleBytestreamMedia>.Callback
DisplayVideoBaseServiceRequest<GoogleBytestreamMedia>.Fields
DisplayVideoBaseServiceRequest<GoogleBytestreamMedia>.Key
DisplayVideoBaseServiceRequest<GoogleBytestreamMedia>.OauthToken
DisplayVideoBaseServiceRequest<GoogleBytestreamMedia>.PrettyPrint
DisplayVideoBaseServiceRequest<GoogleBytestreamMedia>.QuotaUser
DisplayVideoBaseServiceRequest<GoogleBytestreamMedia>.UploadType
DisplayVideoBaseServiceRequest<GoogleBytestreamMedia>.UploadProtocol
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.Execute()
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.ExecuteAsStream()
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.ExecuteAsync()
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.ExecuteAsync(System.Threading.CancellationToken)
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.ExecuteAsStreamAsync()
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.ExecuteAsStreamAsync(System.Threading.CancellationToken)
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.CreateRequest(System.Nullable<System.Boolean>)
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.GenerateRequestUri()
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.GetBody()
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.GetDefaultETagAction(System.String)
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.ETagAction
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.ModifyRequest
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.ValidateParameters
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.RequestParameters
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.Service
Google.Apis.Requests.ClientServiceRequest._unsuccessfulResponseHandlers
Google.Apis.Requests.ClientServiceRequest._exceptionHandlers
Google.Apis.Requests.ClientServiceRequest._executeInterceptors
Google.Apis.Requests.ClientServiceRequest.AddUnsuccessfulResponseHandler(Google.Apis.Http.IHttpUnsuccessfulResponseHandler)
Google.Apis.Requests.ClientServiceRequest.AddExceptionHandler(Google.Apis.Http.IHttpExceptionHandler)
Google.Apis.Requests.ClientServiceRequest.AddExecuteInterceptor(Google.Apis.Http.IHttpExecuteInterceptor)
Google.Apis.Requests.ClientServiceRequest.Credential
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.DisplayVideo.v1
Assembly: Google.Apis.DisplayVideo.v1.dll
Syntax
public class DownloadRequest : DisplayVideoBaseServiceRequest<GoogleBytestreamMedia>, IClientServiceRequest<GoogleBytestreamMedia>, IClientServiceRequest

Constructors

DownloadRequest(IClientService, String)

Constructs a new Download request.

Declaration
public DownloadRequest(IClientService service, string resourceName)
Parameters
Type Name Description
Google.Apis.Services.IClientService service
System.String resourceName

Properties

HttpMethod

Gets the HTTP method.

Declaration
public override string HttpMethod { get; }
Property Value
Type Description
System.String
Overrides
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.HttpMethod

MediaDownloader

Gets the media downloader.

Declaration
public IMediaDownloader MediaDownloader { get; }
Property Value
Type Description
Google.Apis.Download.IMediaDownloader

MethodName

Gets the method name.

Declaration
public override string MethodName { get; }
Property Value
Type Description
System.String
Overrides
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.MethodName

ResourceName

Name of the media that is being downloaded. See ReadRequest.resource_name.

Declaration
[RequestParameter("resourceName", RequestParameterType.Path)]
public virtual string ResourceName { get; }
Property Value
Type Description
System.String

RestPath

Gets the REST path.

Declaration
public override string RestPath { get; }
Property Value
Type Description
System.String
Overrides
Google.Apis.Requests.ClientServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.RestPath

Methods

Download(Stream)

Synchronously download the media into the given stream.

Warning: This method hides download errors; use DownloadWithStatus(Stream) instead.

Declaration
public virtual void Download(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream
Remarks

This method uses the MediaDownloader property to perform the download. Progress event handlers and other configuration may be performed using that property prior to calling this method.

DownloadAsync(Stream)

Asynchronously download the media into the given stream.

Declaration
public virtual Task<IDownloadProgress> DownloadAsync(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream
Returns
Type Description
System.Threading.Tasks.Task<Google.Apis.Download.IDownloadProgress>
Remarks

This method uses the MediaDownloader property to perform the download. Progress event handlers and other configuration may be performed using that property prior to calling this method.

DownloadAsync(Stream, CancellationToken)

Asynchronously download the media into the given stream.

Declaration
public virtual Task<IDownloadProgress> DownloadAsync(Stream stream, CancellationToken cancellationToken)
Parameters
Type Name Description
System.IO.Stream stream
System.Threading.CancellationToken cancellationToken
Returns
Type Description
System.Threading.Tasks.Task<Google.Apis.Download.IDownloadProgress>
Remarks

This method uses the MediaDownloader property to perform the download. Progress event handlers and other configuration may be performed using that property prior to calling this method.

DownloadRange(Stream, RangeHeaderValue)

Synchronously download a range of the media into the given stream.

Declaration
public virtual IDownloadProgress DownloadRange(Stream stream, RangeHeaderValue range)
Parameters
Type Name Description
System.IO.Stream stream
System.Net.Http.Headers.RangeHeaderValue range
Returns
Type Description
Google.Apis.Download.IDownloadProgress
Remarks

This method uses the MediaDownloader property to perform the download. Progress event handlers and other configuration may be performed using that property prior to calling this method.

DownloadRangeAsync(Stream, RangeHeaderValue, CancellationToken)

Asynchronously download a range of the media into the given stream.

Declaration
public virtual Task<IDownloadProgress> DownloadRangeAsync(Stream stream, RangeHeaderValue range, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.IO.Stream stream
System.Net.Http.Headers.RangeHeaderValue range
System.Threading.CancellationToken cancellationToken
Returns
Type Description
System.Threading.Tasks.Task<Google.Apis.Download.IDownloadProgress>
Remarks

This method uses the MediaDownloader property to perform the download. Progress event handlers and other configuration may be performed using that property prior to calling this method.

DownloadWithStatus(Stream)

Synchronously download the media into the given stream.

Declaration
public virtual IDownloadProgress DownloadWithStatus(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream
Returns
Type Description
Google.Apis.Download.IDownloadProgress

The final status of the download; including whether the download succeeded or failed.

Remarks

This method uses the MediaDownloader property to perform the download. Progress event handlers and other configuration may be performed using that property prior to calling this method.

InitParameters()

Initializes Download parameter list.

Declaration
protected override void InitParameters()
Overrides
Google.Apis.DisplayVideo.v1.DisplayVideoBaseServiceRequest<Google.Apis.DisplayVideo.v1.Data.GoogleBytestreamMedia>.InitParameters()

Implements

Google.Apis.Requests.IClientServiceRequest<TResponse>
Google.Apis.Requests.IClientServiceRequest
In This Article
Back to top