| | | 1 | | namespace Microsoft.Azure.ApplicationInsights.Query.Models |
| | | 2 | | { |
| | | 3 | | public class ApiPreferences |
| | | 4 | | { |
| | | 5 | | /// <summary> |
| | | 6 | | /// See https://dev.applicationinsights.io/documentation/Using-the-API/RequestOptions |
| | | 7 | | /// </summary> |
| | 0 | 8 | | public bool IncludeRender { get; set; } = false; |
| | | 9 | | |
| | | 10 | | /// <summary> |
| | | 11 | | /// See https://dev.applicationinsights.io/documentation/Using-the-API/RequestOptions |
| | | 12 | | /// </summary> |
| | 0 | 13 | | public bool IncludeStatistics { get; set; } = false; |
| | | 14 | | |
| | | 15 | | /// <summary> |
| | | 16 | | /// Puts an upper bound on the amount of time the server will spend processing the query. See: https://dev.appli |
| | | 17 | | /// </summary> |
| | 0 | 18 | | public int Wait { get; set; } = int.MinValue; |
| | | 19 | | |
| | | 20 | | public override string ToString() |
| | | 21 | | { |
| | 0 | 22 | | var pref = "response-v1=true"; |
| | 0 | 23 | | if (IncludeRender) |
| | | 24 | | { |
| | 0 | 25 | | pref += ",include-render=true"; |
| | | 26 | | } |
| | 0 | 27 | | if (IncludeStatistics) |
| | | 28 | | { |
| | 0 | 29 | | pref += ",include-statistics=true"; |
| | | 30 | | } |
| | 0 | 31 | | if (Wait != int.MinValue) |
| | | 32 | | { |
| | 0 | 33 | | pref += $",wait={Wait}"; |
| | | 34 | | } |
| | | 35 | | |
| | 0 | 36 | | return pref; |
| | | 37 | | } |
| | | 38 | | } |
| | | 39 | | } |