Skip to content

Commit 5aaee2e

Browse files
author
Basel Rustum
authored
[TSI] Query client library optimizations and improvements (Azure#20673)
1 parent e56ff4d commit 5aaee2e

File tree

37 files changed

+2800
-1479
lines changed

37 files changed

+2800
-1479
lines changed

sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/api/Azure.IoT.TimeSeriesInsights.netstandard2.0.cs

Lines changed: 75 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ namespace Azure.IoT.TimeSeriesInsights
22
{
33
public partial class AggregateSeries
44
{
5-
public AggregateSeries(System.Collections.Generic.IEnumerable<object> timeSeriesId, Azure.IoT.TimeSeriesInsights.DateTimeRange searchSpan, System.TimeSpan interval) { }
5+
public AggregateSeries(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, Azure.IoT.TimeSeriesInsights.DateTimeRange searchSpan, System.TimeSpan interval) { }
66
public Azure.IoT.TimeSeriesInsights.TimeSeriesExpression Filter { get { throw null; } set { } }
77
public System.Collections.Generic.IDictionary<string, Azure.IoT.TimeSeriesInsights.TimeSeriesVariable> InlineVariables { get { throw null; } }
88
public System.TimeSpan Interval { get { throw null; } }
99
public System.Collections.Generic.IList<string> ProjectedVariables { get { throw null; } }
1010
public Azure.IoT.TimeSeriesInsights.DateTimeRange SearchSpan { get { throw null; } }
11-
public System.Collections.Generic.IList<object> TimeSeriesId { get { throw null; } }
11+
public Azure.IoT.TimeSeriesInsights.TimeSeriesId TimeSeriesId { get { throw null; } }
1212
}
1313
public partial class AggregateVariable : Azure.IoT.TimeSeriesInsights.TimeSeriesVariable
1414
{
@@ -209,23 +209,35 @@ internal PagedResponse() { }
209209
public partial class PropertyValues : Azure.IoT.TimeSeriesInsights.EventProperty
210210
{
211211
public PropertyValues() { }
212-
public System.Collections.Generic.IList<object> Values { get { throw null; } }
212+
public Azure.IoT.TimeSeriesInsights.TimeSeriesValue[] Values { get { throw null; } }
213+
}
214+
public partial class QueryAggregateSeriesRequestOptions : Azure.IoT.TimeSeriesInsights.QueryRequestOptions
215+
{
216+
public QueryAggregateSeriesRequestOptions() { }
217+
public System.Collections.Generic.IDictionary<string, Azure.IoT.TimeSeriesInsights.TimeSeriesVariable> InlineVariables { get { throw null; } }
218+
public System.Collections.Generic.List<string> ProjectedVariables { get { throw null; } }
219+
}
220+
public partial class QueryAnalyzer
221+
{
222+
internal QueryAnalyzer() { }
223+
public double? Progress { get { throw null; } }
224+
public Azure.Pageable<Azure.IoT.TimeSeriesInsights.TimeSeriesPoint> GetResults() { throw null; }
225+
public Azure.AsyncPageable<Azure.IoT.TimeSeriesInsights.TimeSeriesPoint> GetResultsAsync() { throw null; }
213226
}
214227
public partial class QueryClient
215228
{
216229
protected QueryClient() { }
217-
public virtual Azure.Pageable<Azure.IoT.TimeSeriesInsights.QueryResultPage> GetEvents(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, System.DateTimeOffset startTime, System.DateTimeOffset endTime, Azure.IoT.TimeSeriesInsights.QueryEventsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
218-
public virtual Azure.Pageable<Azure.IoT.TimeSeriesInsights.QueryResultPage> GetEvents(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, System.TimeSpan timeSpan, System.DateTimeOffset? endTime = default(System.DateTimeOffset?), Azure.IoT.TimeSeriesInsights.QueryEventsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
219-
public virtual Azure.AsyncPageable<Azure.IoT.TimeSeriesInsights.QueryResultPage> GetEventsAsync(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, System.DateTimeOffset startTime, System.DateTimeOffset endTime, Azure.IoT.TimeSeriesInsights.QueryEventsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
220-
public virtual Azure.AsyncPageable<Azure.IoT.TimeSeriesInsights.QueryResultPage> GetEventsAsync(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, System.TimeSpan timeSpan, System.DateTimeOffset? endTime = default(System.DateTimeOffset?), Azure.IoT.TimeSeriesInsights.QueryEventsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
221-
public virtual Azure.Pageable<Azure.IoT.TimeSeriesInsights.QueryResultPage> GetSeries(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, System.DateTimeOffset startTime, System.DateTimeOffset endTime, Azure.IoT.TimeSeriesInsights.QuerySeriesRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
222-
public virtual Azure.Pageable<Azure.IoT.TimeSeriesInsights.QueryResultPage> GetSeries(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, System.TimeSpan timeSpan, System.DateTimeOffset? endTime = default(System.DateTimeOffset?), Azure.IoT.TimeSeriesInsights.QuerySeriesRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
223-
public virtual Azure.AsyncPageable<Azure.IoT.TimeSeriesInsights.QueryResultPage> GetSeriesAsync(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, System.DateTimeOffset startTime, System.DateTimeOffset endTime, Azure.IoT.TimeSeriesInsights.QuerySeriesRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
224-
public virtual Azure.AsyncPageable<Azure.IoT.TimeSeriesInsights.QueryResultPage> GetSeriesAsync(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, System.TimeSpan timeSpan, System.DateTimeOffset? endTime = default(System.DateTimeOffset?), Azure.IoT.TimeSeriesInsights.QuerySeriesRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
230+
public virtual Azure.IoT.TimeSeriesInsights.QueryAnalyzer CreateAggregateSeriesQueryAnalyzer(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, System.DateTimeOffset startTime, System.DateTimeOffset endTime, System.TimeSpan interval, Azure.IoT.TimeSeriesInsights.QueryAggregateSeriesRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
231+
public virtual Azure.IoT.TimeSeriesInsights.QueryAnalyzer CreateAggregateSeriesQueryAnalyzer(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, System.TimeSpan interval, System.TimeSpan timeSpan, System.DateTimeOffset? endTime = default(System.DateTimeOffset?), Azure.IoT.TimeSeriesInsights.QueryAggregateSeriesRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
232+
public virtual Azure.IoT.TimeSeriesInsights.QueryAnalyzer CreateEventsQueryAnalyzer(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, System.DateTimeOffset startTime, System.DateTimeOffset endTime, Azure.IoT.TimeSeriesInsights.QueryEventsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
233+
public virtual Azure.IoT.TimeSeriesInsights.QueryAnalyzer CreateEventsQueryAnalyzer(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, System.TimeSpan timeSpan, System.DateTimeOffset? endTime = default(System.DateTimeOffset?), Azure.IoT.TimeSeriesInsights.QueryEventsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
234+
public virtual Azure.IoT.TimeSeriesInsights.QueryAnalyzer CreateSeriesQueryAnalyzer(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, System.DateTimeOffset startTime, System.DateTimeOffset endTime, Azure.IoT.TimeSeriesInsights.QuerySeriesRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
235+
public virtual Azure.IoT.TimeSeriesInsights.QueryAnalyzer CreateSeriesQueryAnalyzer(Azure.IoT.TimeSeriesInsights.TimeSeriesId timeSeriesId, System.TimeSpan timeSpan, System.DateTimeOffset? endTime = default(System.DateTimeOffset?), Azure.IoT.TimeSeriesInsights.QuerySeriesRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
225236
}
226237
public partial class QueryEventsRequestOptions : Azure.IoT.TimeSeriesInsights.QueryRequestOptions
227238
{
228239
public QueryEventsRequestOptions() { }
240+
public int? MaximumNumberOfEvents { get { throw null; } set { } }
229241
public System.Collections.Generic.List<Azure.IoT.TimeSeriesInsights.EventProperty> ProjectedProperties { get { throw null; } }
230242
}
231243
public partial class QueryRequest
@@ -239,7 +251,6 @@ public abstract partial class QueryRequestOptions
239251
{
240252
protected QueryRequestOptions() { }
241253
public string Filter { get { throw null; } set { } }
242-
public int? MaximumNumberOfEvents { get { throw null; } set { } }
243254
public Azure.IoT.TimeSeriesInsights.StoreType StoreType { get { throw null; } set { } }
244255
}
245256
public partial class QueryResultPage : Azure.IoT.TimeSeriesInsights.PagedResponse
@@ -253,6 +264,7 @@ public partial class QuerySeriesRequestOptions : Azure.IoT.TimeSeriesInsights.Qu
253264
{
254265
public QuerySeriesRequestOptions() { }
255266
public System.Collections.Generic.IDictionary<string, Azure.IoT.TimeSeriesInsights.TimeSeriesVariable> InlineVariables { get { throw null; } }
267+
public int? MaximumNumberOfEvents { get { throw null; } set { } }
256268
public System.Collections.Generic.List<string> ProjectedVariables { get { throw null; } }
257269
}
258270
public partial class StoreType
@@ -373,6 +385,16 @@ internal TimeSeriesOperationErrorDetails() { }
373385
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
374386
public bool TryGetValue(string key, out object value) { throw null; }
375387
}
388+
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
389+
public partial struct TimeSeriesPoint
390+
{
391+
private object _dummy;
392+
private int _dummyPrimitive;
393+
public TimeSeriesPoint(System.DateTimeOffset timestamp, System.Collections.Generic.IDictionary<string, Azure.IoT.TimeSeriesInsights.PropertyValues> propertyNameToPageValues, int index) { throw null; }
394+
public System.DateTimeOffset Timestamp { get { throw null; } }
395+
public string[] GetUniquePropertyNames() { throw null; }
396+
public Azure.IoT.TimeSeriesInsights.TimeSeriesValue GetValue(string propertyName) { throw null; }
397+
}
376398
public partial class TimeSeriesType
377399
{
378400
public TimeSeriesType(string name, System.Collections.Generic.IDictionary<string, Azure.IoT.TimeSeriesInsights.TimeSeriesVariable> variables) { }
@@ -387,6 +409,47 @@ internal TimeSeriesTypeOperationResult() { }
387409
public Azure.IoT.TimeSeriesInsights.TimeSeriesOperationError Error { get { throw null; } }
388410
public Azure.IoT.TimeSeriesInsights.TimeSeriesType TimeSeriesType { get { throw null; } }
389411
}
412+
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
413+
public readonly partial struct TimeSeriesValue
414+
{
415+
private readonly object _dummy;
416+
private readonly int _dummyPrimitive;
417+
public TimeSeriesValue(bool value) { throw null; }
418+
public TimeSeriesValue(byte[] utf8, int index, int count) { throw null; }
419+
public TimeSeriesValue(System.DateTimeOffset value) { throw null; }
420+
public TimeSeriesValue(double value) { throw null; }
421+
public TimeSeriesValue(int value) { throw null; }
422+
public TimeSeriesValue(bool? value) { throw null; }
423+
public TimeSeriesValue(System.DateTimeOffset? value) { throw null; }
424+
public TimeSeriesValue(double? value) { throw null; }
425+
public TimeSeriesValue(int? value) { throw null; }
426+
public TimeSeriesValue(System.TimeSpan? value) { throw null; }
427+
public TimeSeriesValue(string value) { throw null; }
428+
public TimeSeriesValue(System.TimeSpan value) { throw null; }
429+
public System.Type Type { get { throw null; } }
430+
public static explicit operator bool (Azure.IoT.TimeSeriesInsights.TimeSeriesValue variant) { throw null; }
431+
public static explicit operator System.DateTimeOffset (Azure.IoT.TimeSeriesInsights.TimeSeriesValue variant) { throw null; }
432+
public static explicit operator double (Azure.IoT.TimeSeriesInsights.TimeSeriesValue variant) { throw null; }
433+
public static explicit operator int (Azure.IoT.TimeSeriesInsights.TimeSeriesValue variant) { throw null; }
434+
public static explicit operator bool? (Azure.IoT.TimeSeriesInsights.TimeSeriesValue variant) { throw null; }
435+
public static explicit operator System.DateTimeOffset? (Azure.IoT.TimeSeriesInsights.TimeSeriesValue variant) { throw null; }
436+
public static explicit operator double? (Azure.IoT.TimeSeriesInsights.TimeSeriesValue variant) { throw null; }
437+
public static explicit operator int? (Azure.IoT.TimeSeriesInsights.TimeSeriesValue variant) { throw null; }
438+
public static explicit operator System.TimeSpan? (Azure.IoT.TimeSeriesInsights.TimeSeriesValue variant) { throw null; }
439+
public static explicit operator string (Azure.IoT.TimeSeriesInsights.TimeSeriesValue variant) { throw null; }
440+
public static explicit operator System.TimeSpan (Azure.IoT.TimeSeriesInsights.TimeSeriesValue variant) { throw null; }
441+
public static implicit operator Azure.IoT.TimeSeriesInsights.TimeSeriesValue (bool value) { throw null; }
442+
public static implicit operator Azure.IoT.TimeSeriesInsights.TimeSeriesValue (System.DateTimeOffset value) { throw null; }
443+
public static implicit operator Azure.IoT.TimeSeriesInsights.TimeSeriesValue (double value) { throw null; }
444+
public static implicit operator Azure.IoT.TimeSeriesInsights.TimeSeriesValue (int value) { throw null; }
445+
public static implicit operator Azure.IoT.TimeSeriesInsights.TimeSeriesValue (bool? value) { throw null; }
446+
public static implicit operator Azure.IoT.TimeSeriesInsights.TimeSeriesValue (System.DateTimeOffset? value) { throw null; }
447+
public static implicit operator Azure.IoT.TimeSeriesInsights.TimeSeriesValue (double? value) { throw null; }
448+
public static implicit operator Azure.IoT.TimeSeriesInsights.TimeSeriesValue (int? value) { throw null; }
449+
public static implicit operator Azure.IoT.TimeSeriesInsights.TimeSeriesValue (System.TimeSpan? value) { throw null; }
450+
public static implicit operator Azure.IoT.TimeSeriesInsights.TimeSeriesValue (string value) { throw null; }
451+
public static implicit operator Azure.IoT.TimeSeriesInsights.TimeSeriesValue (System.TimeSpan value) { throw null; }
452+
}
390453
public partial class TimeSeriesVariable
391454
{
392455
public TimeSeriesVariable() { }
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using System.Text.Json;
5+
using Azure.Core;
6+
7+
namespace Azure.IoT.TimeSeriesInsights
8+
{
9+
/// <summary>
10+
/// This class definition overrides serialization and deserialization implementation in
11+
/// order to turn Time Series Ids from a strongly typed object to an list of objects that
12+
/// the service can understand, and vice versa.
13+
/// </summary>
14+
public partial class AggregateSeries : IUtf8JsonSerializable
15+
{
16+
// The use of fully qualified name for IUtf8JsonSerializable is a work around until this
17+
// issue is fixed: https://github.com/Azure/autorest.csharp/issues/793
18+
void global::Azure.Core.IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
19+
{
20+
writer.WriteStartObject();
21+
writer.WritePropertyName("timeSeriesId");
22+
writer.WriteStartArray();
23+
foreach (var item in TimeSeriesId.ToArray())
24+
{
25+
writer.WriteObjectValue(item);
26+
}
27+
writer.WriteEndArray();
28+
writer.WritePropertyName("searchSpan");
29+
writer.WriteObjectValue(SearchSpan);
30+
if (Optional.IsDefined(Filter))
31+
{
32+
writer.WritePropertyName("filter");
33+
writer.WriteObjectValue(Filter);
34+
}
35+
writer.WritePropertyName("interval");
36+
writer.WriteStringValue(Interval, "P");
37+
if (Optional.IsCollectionDefined(ProjectedVariables))
38+
{
39+
writer.WritePropertyName("projectedVariables");
40+
writer.WriteStartArray();
41+
foreach (var item in ProjectedVariables)
42+
{
43+
writer.WriteStringValue(item);
44+
}
45+
writer.WriteEndArray();
46+
}
47+
if (Optional.IsCollectionDefined(InlineVariables))
48+
{
49+
writer.WritePropertyName("inlineVariables");
50+
writer.WriteStartObject();
51+
foreach (var item in InlineVariables)
52+
{
53+
writer.WritePropertyName(item.Key);
54+
writer.WriteObjectValue(item.Value);
55+
}
56+
writer.WriteEndObject();
57+
}
58+
writer.WriteEndObject();
59+
}
60+
}
61+
}

0 commit comments

Comments
 (0)