Struct ReportRequest

Source
pub struct ReportRequest {
Show 17 fields pub cohort_group: Option<CohortGroup>, pub date_ranges: Option<Vec<DateRange>>, pub dimension_filter_clauses: Option<Vec<DimensionFilterClause>>, pub dimensions: Option<Vec<Dimension>>, pub filters_expression: Option<String>, pub hide_totals: Option<bool>, pub hide_value_ranges: Option<bool>, pub include_empty_rows: Option<bool>, pub metric_filter_clauses: Option<Vec<MetricFilterClause>>, pub metrics: Option<Vec<Metric>>, pub order_bys: Option<Vec<OrderBy>>, pub page_size: Option<i32>, pub page_token: Option<String>, pub pivots: Option<Vec<Pivot>>, pub sampling_level: Option<String>, pub segments: Option<Vec<Segment>>, pub view_id: Option<String>,
}
Expand description

The main request class which specifies the Reporting API request.

This type is not used in any activity, and only used as part of another schema.

Fields§

§cohort_group: Option<CohortGroup>

Cohort group associated with this request. If there is a cohort group in the request the ga:cohort dimension must be present. Every ReportRequest within a batchGet method must contain the same cohortGroup definition.

§date_ranges: Option<Vec<DateRange>>

Date ranges in the request. The request can have a maximum of 2 date ranges. The response will contain a set of metric values for each combination of the dimensions for each date range in the request. So, if there are two date ranges, there will be two set of metric values, one for the original date range and one for the second date range. The reportRequest.dateRanges field should not be specified for cohorts or Lifetime value requests. If a date range is not provided, the default date range is (startDate: current date - 7 days, endDate: current date - 1 day). Every ReportRequest within a batchGet method must contain the same dateRanges definition.

§dimension_filter_clauses: Option<Vec<DimensionFilterClause>>

The dimension filter clauses for filtering Dimension Values. They are logically combined with the AND operator. Note that filtering occurs before any dimensions are aggregated, so that the returned metrics represent the total for only the relevant dimensions.

§dimensions: Option<Vec<Dimension>>

The dimensions requested. Requests can have a total of 9 dimensions.

§filters_expression: Option<String>

Dimension or metric filters that restrict the data returned for your request. To use the filtersExpression, supply a dimension or metric on which to filter, followed by the filter expression. For example, the following expression selects ga:browser dimension which starts with Firefox; ga:browser=~^Firefox. For more information on dimensions and metric filters, see Filters reference.

§hide_totals: Option<bool>

If set to true, hides the total of all metrics for all the matching rows, for every date range. The default false and will return the totals.

§hide_value_ranges: Option<bool>

If set to true, hides the minimum and maximum across all matching rows. The default is false and the value ranges are returned.

§include_empty_rows: Option<bool>

If set to false, the response does not include rows if all the retrieved metrics are equal to zero. The default is false which will exclude these rows.

§metric_filter_clauses: Option<Vec<MetricFilterClause>>

The metric filter clauses. They are logically combined with the AND operator. Metric filters look at only the first date range and not the comparing date range. Note that filtering on metrics occurs after the metrics are aggregated.

§metrics: Option<Vec<Metric>>

The metrics requested. Requests must specify at least one metric. Requests can have a total of 10 metrics.

§order_bys: Option<Vec<OrderBy>>

Sort order on output rows. To compare two rows, the elements of the following are applied in order until a difference is found. All date ranges in the output get the same row order.

§page_size: Option<i32>

Page size is for paging and specifies the maximum number of returned rows. Page size should be >= 0. A query returns the default of 1,000 rows. The Analytics Core Reporting API returns a maximum of 100,000 rows per request, no matter how many you ask for. It can also return fewer rows than requested, if there aren’t as many dimension segments as you expect. For instance, there are fewer than 300 possible values for ga:country, so when segmenting only by country, you can’t get more than 300 rows, even if you set pageSize to a higher value.

§page_token: Option<String>

A continuation token to get the next page of the results. Adding this to the request will return the rows after the pageToken. The pageToken should be the value returned in the nextPageToken parameter in the response to the GetReports request.

§pivots: Option<Vec<Pivot>>

The pivot definitions. Requests can have a maximum of 2 pivots.

§sampling_level: Option<String>

The desired report sample size. If the the samplingLevel field is unspecified the DEFAULT sampling level is used. Every ReportRequest within a batchGet method must contain the same samplingLevel definition. See developer guide for details.

§segments: Option<Vec<Segment>>

Segment the data returned for the request. A segment definition helps look at a subset of the segment request. A request can contain up to four segments. Every ReportRequest within a batchGet method must contain the same segments definition. Requests with segments must have the ga:segment dimension.

§view_id: Option<String>

The Analytics view ID from which to retrieve data. Every ReportRequest within a batchGet method must contain the same viewId.

Trait Implementations§

Source§

impl Clone for ReportRequest

Source§

fn clone(&self) -> ReportRequest

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReportRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ReportRequest

Source§

fn default() -> ReportRequest

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ReportRequest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ReportRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Part for ReportRequest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,