/// <summary> /// Initializes a new instance of the <see cref="ObservationQuery" /> class. /// </summary> /// <param name="Filter">Filter to return a subset of observations. Expresses boolean logical predicates as well as dimensional filters (required).</param> /// <param name="Metrics">Behaves like a SQL SELECT clause. Enables retrieving only named metrics. If omitted, all metrics that are available will be returned (like SELECT *)..</param> public ObservationQuery(AnalyticsQueryFilter Filter = null, List <MetricsEnum> Metrics = null) { // to ensure "Filter" is required (not null) if (Filter == null) { throw new InvalidDataException("Filter is a required property for ObservationQuery and cannot be null"); } else { this.Filter = Filter; } this.Metrics = Metrics; }
/// <summary> /// Initializes a new instance of the <see cref="AggregationQuery" /> class. /// </summary> /// <param name="Interval">Behaves like one clause in a SQL WHERE. Specifies the date and time range of data being queried. Intervals are represented as an ISO-8601 string. For example: YYYY-MM-DDThh:mm:ss/YYYY-MM-DDThh:mm:ss.</param> /// <param name="Granularity">Granularity aggregates metrics into subpartitions within the time interval specified. The default granularity is the same duration as the interval. Periods are represented as an ISO-8601 string. For example: P1D or P1DT12H.</param> /// <param name="TimeZone">Sets the time zone for the query interval, defaults to UTC. Time zones are represented as an ISO-8601 string. For example: UTC, UTC+01:00, or Europe/London.</param> /// <param name="GroupBy">Behaves like a SQL GROUPBY. Allows for multiple levels of grouping as a list of dimensions. Partitions resulting aggregate computations into distinct named subgroups rather than across the entire result set as if it were one group..</param> /// <param name="Filter">Behaves like a SQL WHERE clause. This is ANDed with the interval parameter. Expresses boolean logical predicates as well as dimensional filters.</param> /// <param name="Metrics">Behaves like a SQL SELECT clause. Enables retrieving only named metrics. If omitted, all metrics that are available will be returned (like SELECT *)..</param> /// <param name="FlattenMultivaluedDimensions">Flattens any multivalued dimensions used in response groups (e.g. ['a','b','c']->'a,b,c').</param> public AggregationQuery(string Interval = null, string Granularity = null, string TimeZone = null, List <GroupByEnum> GroupBy = null, AnalyticsQueryFilter Filter = null, List <MetricsEnum> Metrics = null, bool?FlattenMultivaluedDimensions = null) { this.Interval = Interval; this.Granularity = Granularity; this.TimeZone = TimeZone; this.GroupBy = GroupBy; this.Filter = Filter; this.Metrics = Metrics; this.FlattenMultivaluedDimensions = FlattenMultivaluedDimensions; }