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
ClientServiceRequest
ClientServiceRequest<GoogleBytestreamMedia>
DisplayVideoBaseServiceRequest<GoogleBytestreamMedia>
MediaResource.DownloadRequest
Implements
IClientServiceRequest<GoogleBytestreamMedia>
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
ClientServiceRequest<GoogleBytestreamMedia>.Execute()
ClientServiceRequest<GoogleBytestreamMedia>.ExecuteAsStream()
ClientServiceRequest<GoogleBytestreamMedia>.ExecuteAsync()
ClientServiceRequest<GoogleBytestreamMedia>.ExecuteAsync(CancellationToken)
ClientServiceRequest<GoogleBytestreamMedia>.ExecuteAsStreamAsync()
ClientServiceRequest<GoogleBytestreamMedia>.ExecuteAsStreamAsync(CancellationToken)
ClientServiceRequest<GoogleBytestreamMedia>.CreateRequest(Nullable<Boolean>)
ClientServiceRequest<GoogleBytestreamMedia>.GenerateRequestUri()
ClientServiceRequest<GoogleBytestreamMedia>.GetBody()
ClientServiceRequest<GoogleBytestreamMedia>.GetDefaultETagAction(String)
ClientServiceRequest<GoogleBytestreamMedia>.ETagAction
ClientServiceRequest<GoogleBytestreamMedia>.ModifyRequest
ClientServiceRequest<GoogleBytestreamMedia>.ValidateParameters
ClientServiceRequest<GoogleBytestreamMedia>.RequestParameters
ClientServiceRequest<GoogleBytestreamMedia>.Service
ClientServiceRequest._unsuccessfulResponseHandlers
ClientServiceRequest._exceptionHandlers
ClientServiceRequest._executeInterceptors
ClientServiceRequest.AddUnsuccessfulResponseHandler(IHttpUnsuccessfulResponseHandler)
ClientServiceRequest.AddExceptionHandler(IHttpExceptionHandler)
ClientServiceRequest.AddExecuteInterceptor(IHttpExecuteInterceptor)
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
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
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<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<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
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<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
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

IClientServiceRequest<TResponse>
IClientServiceRequest
In This Article
Back to top Generated by DocFX