Class ReportsResource.GenerateRequest
Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
Inheritance
Implements
Inherited Members
Namespace: Google.Apis.AdSense.v1_4
Assembly: Google.Apis.AdSense.v1_4.dll
Syntax
public class GenerateRequest : AdSenseBaseServiceRequest<AdsenseReportsGenerateResponse>, IClientServiceRequest<AdsenseReportsGenerateResponse>, IClientServiceRequest
Constructors
GenerateRequest(IClientService, String, String)
Constructs a new Generate request.
Declaration
public GenerateRequest(IClientService service, string startDate, string endDate)
Parameters
Type | Name | Description |
---|---|---|
Google.Apis.Services.IClientService | service | |
System.String | startDate | |
System.String | endDate |
Properties
AccountId
Accounts upon which to report.
Declaration
[RequestParameter("accountId", RequestParameterType.Query)]
public virtual Repeatable<string> AccountId { get; set; }
Property Value
Type | Description |
---|---|
Google.Apis.Util.Repeatable<System.String> |
Currency
Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.
Declaration
[RequestParameter("currency", RequestParameterType.Query)]
public virtual string Currency { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Dimension
Dimensions to base the report on.
Declaration
[RequestParameter("dimension", RequestParameterType.Query)]
public virtual Repeatable<string> Dimension { get; set; }
Property Value
Type | Description |
---|---|
Google.Apis.Util.Repeatable<System.String> |
EndDate
End of the date range to report on in "YYYY-MM-DD" format, inclusive.
Declaration
[RequestParameter("endDate", RequestParameterType.Query)]
public virtual string EndDate { get; }
Property Value
Type | Description |
---|---|
System.String |
Filter
Filters to be run on the report.
Declaration
[RequestParameter("filter", RequestParameterType.Query)]
public virtual Repeatable<string> Filter { get; set; }
Property Value
Type | Description |
---|---|
Google.Apis.Util.Repeatable<System.String> |
HttpMethod
Gets the HTTP method.
Declaration
public override string HttpMethod { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Locale
Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified.
Declaration
[RequestParameter("locale", RequestParameterType.Query)]
public virtual string Locale { get; set; }
Property Value
Type | Description |
---|---|
System.String |
MaxResults
The maximum number of rows of report data to return.
Declaration
[RequestParameter("maxResults", RequestParameterType.Query)]
public virtual int? MaxResults { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
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
Metric
Numeric columns to include in the report.
Declaration
[RequestParameter("metric", RequestParameterType.Query)]
public virtual Repeatable<string> Metric { get; set; }
Property Value
Type | Description |
---|---|
Google.Apis.Util.Repeatable<System.String> |
RestPath
Gets the REST path.
Declaration
public override string RestPath { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Sort
The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending.
Declaration
[RequestParameter("sort", RequestParameterType.Query)]
public virtual Repeatable<string> Sort { get; set; }
Property Value
Type | Description |
---|---|
Google.Apis.Util.Repeatable<System.String> |
StartDate
Start of the date range to report on in "YYYY-MM-DD" format, inclusive.
Declaration
[RequestParameter("startDate", RequestParameterType.Query)]
public virtual string StartDate { get; }
Property Value
Type | Description |
---|---|
System.String |
StartIndex
Index of the first row of report data to return.
Declaration
[RequestParameter("startIndex", RequestParameterType.Query)]
public virtual int? StartIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
UseTimezoneReporting
Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.
Declaration
[RequestParameter("useTimezoneReporting", RequestParameterType.Query)]
public virtual bool? UseTimezoneReporting { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
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 Generate parameter list.
Declaration
protected override void InitParameters()