| | | 1 | | // <auto-generated> |
| | | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | | 4 | | // license information. |
| | | 5 | | // |
| | | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | | 8 | | // regenerated. |
| | | 9 | | // </auto-generated> |
| | | 10 | | |
| | | 11 | | namespace Microsoft.Azure.ApplicationInsights.Query |
| | | 12 | | { |
| | | 13 | | using Microsoft.Rest; |
| | | 14 | | using Microsoft.Rest.Serialization; |
| | | 15 | | using Models; |
| | | 16 | | using Newtonsoft.Json; |
| | | 17 | | using System.Collections; |
| | | 18 | | using System.Collections.Generic; |
| | | 19 | | using System.Net; |
| | | 20 | | using System.Net.Http; |
| | | 21 | | |
| | | 22 | | /// <summary> |
| | | 23 | | /// Composite Swagger for Application Insights Data Client |
| | | 24 | | /// </summary> |
| | | 25 | | public partial class ApplicationInsightsDataClient : ServiceClient<ApplicationInsightsDataClient>, IApplicationInsig |
| | | 26 | | { |
| | | 27 | | /// <summary> |
| | | 28 | | /// The base URI of the service. |
| | | 29 | | /// </summary> |
| | 80 | 30 | | public System.Uri BaseUri { get; set; } |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// Gets or sets json serialization settings. |
| | | 34 | | /// </summary> |
| | 60 | 35 | | public JsonSerializerSettings SerializationSettings { get; private set; } |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// Gets or sets json deserialization settings. |
| | | 39 | | /// </summary> |
| | 80 | 40 | | public JsonSerializerSettings DeserializationSettings { get; private set; } |
| | | 41 | | |
| | | 42 | | /// <summary> |
| | | 43 | | /// Subscription credentials which uniquely identify client subscription. |
| | | 44 | | /// </summary> |
| | 140 | 45 | | public ServiceClientCredentials Credentials { get; private set; } |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// Gets the IMetrics. |
| | | 49 | | /// </summary> |
| | 0 | 50 | | public virtual IMetrics Metrics { get; private set; } |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// Gets the IEvents. |
| | | 54 | | /// </summary> |
| | 60 | 55 | | public virtual IEvents Events { get; private set; } |
| | | 56 | | |
| | | 57 | | /// <summary> |
| | | 58 | | /// Gets the IQueryOperations. |
| | | 59 | | /// </summary> |
| | 0 | 60 | | public virtual IQueryOperations Query { get; private set; } |
| | | 61 | | |
| | | 62 | | /// <summary> |
| | | 63 | | /// Initializes a new instance of the ApplicationInsightsDataClient class. |
| | | 64 | | /// </summary> |
| | | 65 | | /// <param name='httpClient'> |
| | | 66 | | /// HttpClient to be used |
| | | 67 | | /// </param> |
| | | 68 | | /// <param name='disposeHttpClient'> |
| | | 69 | | /// True: will dispose the provided httpClient on calling ApplicationInsightsDataClient.Dispose(). False: will n |
| | 0 | 70 | | protected ApplicationInsightsDataClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, dispos |
| | | 71 | | { |
| | 0 | 72 | | Initialize(); |
| | 0 | 73 | | } |
| | | 74 | | |
| | | 75 | | /// <summary> |
| | | 76 | | /// Initializes a new instance of the ApplicationInsightsDataClient class. |
| | | 77 | | /// </summary> |
| | | 78 | | /// <param name='handlers'> |
| | | 79 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | | 80 | | /// </param> |
| | 20 | 81 | | protected ApplicationInsightsDataClient(params DelegatingHandler[] handlers) : base(handlers) |
| | | 82 | | { |
| | 20 | 83 | | Initialize(); |
| | 20 | 84 | | } |
| | | 85 | | |
| | | 86 | | /// <summary> |
| | | 87 | | /// Initializes a new instance of the ApplicationInsightsDataClient class. |
| | | 88 | | /// </summary> |
| | | 89 | | /// <param name='rootHandler'> |
| | | 90 | | /// Optional. The http client handler used to handle http transport. |
| | | 91 | | /// </param> |
| | | 92 | | /// <param name='handlers'> |
| | | 93 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | | 94 | | /// </param> |
| | 0 | 95 | | protected ApplicationInsightsDataClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : ba |
| | | 96 | | { |
| | 0 | 97 | | Initialize(); |
| | 0 | 98 | | } |
| | | 99 | | |
| | | 100 | | /// <summary> |
| | | 101 | | /// Initializes a new instance of the ApplicationInsightsDataClient class. |
| | | 102 | | /// </summary> |
| | | 103 | | /// <param name='baseUri'> |
| | | 104 | | /// Optional. The base URI of the service. |
| | | 105 | | /// </param> |
| | | 106 | | /// <param name='handlers'> |
| | | 107 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | | 108 | | /// </param> |
| | | 109 | | /// <exception cref="System.ArgumentNullException"> |
| | | 110 | | /// Thrown when a required parameter is null |
| | | 111 | | /// </exception> |
| | 0 | 112 | | protected ApplicationInsightsDataClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers |
| | | 113 | | { |
| | 0 | 114 | | if (baseUri == null) |
| | | 115 | | { |
| | 0 | 116 | | throw new System.ArgumentNullException("baseUri"); |
| | | 117 | | } |
| | 0 | 118 | | BaseUri = baseUri; |
| | 0 | 119 | | } |
| | | 120 | | |
| | | 121 | | /// <summary> |
| | | 122 | | /// Initializes a new instance of the ApplicationInsightsDataClient class. |
| | | 123 | | /// </summary> |
| | | 124 | | /// <param name='baseUri'> |
| | | 125 | | /// Optional. The base URI of the service. |
| | | 126 | | /// </param> |
| | | 127 | | /// <param name='rootHandler'> |
| | | 128 | | /// Optional. The http client handler used to handle http transport. |
| | | 129 | | /// </param> |
| | | 130 | | /// <param name='handlers'> |
| | | 131 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | | 132 | | /// </param> |
| | | 133 | | /// <exception cref="System.ArgumentNullException"> |
| | | 134 | | /// Thrown when a required parameter is null |
| | | 135 | | /// </exception> |
| | 0 | 136 | | protected ApplicationInsightsDataClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHand |
| | | 137 | | { |
| | 0 | 138 | | if (baseUri == null) |
| | | 139 | | { |
| | 0 | 140 | | throw new System.ArgumentNullException("baseUri"); |
| | | 141 | | } |
| | 0 | 142 | | BaseUri = baseUri; |
| | 0 | 143 | | } |
| | | 144 | | |
| | | 145 | | /// <summary> |
| | | 146 | | /// Initializes a new instance of the ApplicationInsightsDataClient class. |
| | | 147 | | /// </summary> |
| | | 148 | | /// <param name='credentials'> |
| | | 149 | | /// Required. Subscription credentials which uniquely identify client subscription. |
| | | 150 | | /// </param> |
| | | 151 | | /// <param name='handlers'> |
| | | 152 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | | 153 | | /// </param> |
| | | 154 | | /// <exception cref="System.ArgumentNullException"> |
| | | 155 | | /// Thrown when a required parameter is null |
| | | 156 | | /// </exception> |
| | 20 | 157 | | public ApplicationInsightsDataClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) |
| | | 158 | | { |
| | 20 | 159 | | if (credentials == null) |
| | | 160 | | { |
| | 0 | 161 | | throw new System.ArgumentNullException("credentials"); |
| | | 162 | | } |
| | 20 | 163 | | Credentials = credentials; |
| | 20 | 164 | | if (Credentials != null) |
| | | 165 | | { |
| | 20 | 166 | | Credentials.InitializeServiceClient(this); |
| | | 167 | | } |
| | 20 | 168 | | } |
| | | 169 | | |
| | | 170 | | /// <summary> |
| | | 171 | | /// Initializes a new instance of the ApplicationInsightsDataClient class. |
| | | 172 | | /// </summary> |
| | | 173 | | /// <param name='credentials'> |
| | | 174 | | /// Required. Subscription credentials which uniquely identify client subscription. |
| | | 175 | | /// </param> |
| | | 176 | | /// <param name='httpClient'> |
| | | 177 | | /// HttpClient to be used |
| | | 178 | | /// </param> |
| | | 179 | | /// <param name='disposeHttpClient'> |
| | | 180 | | /// True: will dispose the provided httpClient on calling ApplicationInsightsDataClient.Dispose(). False: will n |
| | | 181 | | /// <exception cref="System.ArgumentNullException"> |
| | | 182 | | /// Thrown when a required parameter is null |
| | | 183 | | /// </exception> |
| | 0 | 184 | | public ApplicationInsightsDataClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHt |
| | | 185 | | { |
| | 0 | 186 | | if (credentials == null) |
| | | 187 | | { |
| | 0 | 188 | | throw new System.ArgumentNullException("credentials"); |
| | | 189 | | } |
| | 0 | 190 | | Credentials = credentials; |
| | 0 | 191 | | if (Credentials != null) |
| | | 192 | | { |
| | 0 | 193 | | Credentials.InitializeServiceClient(this); |
| | | 194 | | } |
| | 0 | 195 | | } |
| | | 196 | | |
| | | 197 | | /// <summary> |
| | | 198 | | /// Initializes a new instance of the ApplicationInsightsDataClient class. |
| | | 199 | | /// </summary> |
| | | 200 | | /// <param name='credentials'> |
| | | 201 | | /// Required. Subscription credentials which uniquely identify client subscription. |
| | | 202 | | /// </param> |
| | | 203 | | /// <param name='rootHandler'> |
| | | 204 | | /// Optional. The http client handler used to handle http transport. |
| | | 205 | | /// </param> |
| | | 206 | | /// <param name='handlers'> |
| | | 207 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | | 208 | | /// </param> |
| | | 209 | | /// <exception cref="System.ArgumentNullException"> |
| | | 210 | | /// Thrown when a required parameter is null |
| | | 211 | | /// </exception> |
| | 0 | 212 | | public ApplicationInsightsDataClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params |
| | | 213 | | { |
| | 0 | 214 | | if (credentials == null) |
| | | 215 | | { |
| | 0 | 216 | | throw new System.ArgumentNullException("credentials"); |
| | | 217 | | } |
| | 0 | 218 | | Credentials = credentials; |
| | 0 | 219 | | if (Credentials != null) |
| | | 220 | | { |
| | 0 | 221 | | Credentials.InitializeServiceClient(this); |
| | | 222 | | } |
| | 0 | 223 | | } |
| | | 224 | | |
| | | 225 | | /// <summary> |
| | | 226 | | /// Initializes a new instance of the ApplicationInsightsDataClient class. |
| | | 227 | | /// </summary> |
| | | 228 | | /// <param name='baseUri'> |
| | | 229 | | /// Optional. The base URI of the service. |
| | | 230 | | /// </param> |
| | | 231 | | /// <param name='credentials'> |
| | | 232 | | /// Required. Subscription credentials which uniquely identify client subscription. |
| | | 233 | | /// </param> |
| | | 234 | | /// <param name='handlers'> |
| | | 235 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | | 236 | | /// </param> |
| | | 237 | | /// <exception cref="System.ArgumentNullException"> |
| | | 238 | | /// Thrown when a required parameter is null |
| | | 239 | | /// </exception> |
| | 0 | 240 | | public ApplicationInsightsDataClient(System.Uri baseUri, ServiceClientCredentials credentials, params Delegating |
| | | 241 | | { |
| | 0 | 242 | | if (baseUri == null) |
| | | 243 | | { |
| | 0 | 244 | | throw new System.ArgumentNullException("baseUri"); |
| | | 245 | | } |
| | 0 | 246 | | if (credentials == null) |
| | | 247 | | { |
| | 0 | 248 | | throw new System.ArgumentNullException("credentials"); |
| | | 249 | | } |
| | 0 | 250 | | BaseUri = baseUri; |
| | 0 | 251 | | Credentials = credentials; |
| | 0 | 252 | | if (Credentials != null) |
| | | 253 | | { |
| | 0 | 254 | | Credentials.InitializeServiceClient(this); |
| | | 255 | | } |
| | 0 | 256 | | } |
| | | 257 | | |
| | | 258 | | /// <summary> |
| | | 259 | | /// Initializes a new instance of the ApplicationInsightsDataClient class. |
| | | 260 | | /// </summary> |
| | | 261 | | /// <param name='baseUri'> |
| | | 262 | | /// Optional. The base URI of the service. |
| | | 263 | | /// </param> |
| | | 264 | | /// <param name='credentials'> |
| | | 265 | | /// Required. Subscription credentials which uniquely identify client subscription. |
| | | 266 | | /// </param> |
| | | 267 | | /// <param name='rootHandler'> |
| | | 268 | | /// Optional. The http client handler used to handle http transport. |
| | | 269 | | /// </param> |
| | | 270 | | /// <param name='handlers'> |
| | | 271 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | | 272 | | /// </param> |
| | | 273 | | /// <exception cref="System.ArgumentNullException"> |
| | | 274 | | /// Thrown when a required parameter is null |
| | | 275 | | /// </exception> |
| | 0 | 276 | | public ApplicationInsightsDataClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler |
| | | 277 | | { |
| | 0 | 278 | | if (baseUri == null) |
| | | 279 | | { |
| | 0 | 280 | | throw new System.ArgumentNullException("baseUri"); |
| | | 281 | | } |
| | 0 | 282 | | if (credentials == null) |
| | | 283 | | { |
| | 0 | 284 | | throw new System.ArgumentNullException("credentials"); |
| | | 285 | | } |
| | 0 | 286 | | BaseUri = baseUri; |
| | 0 | 287 | | Credentials = credentials; |
| | 0 | 288 | | if (Credentials != null) |
| | | 289 | | { |
| | 0 | 290 | | Credentials.InitializeServiceClient(this); |
| | | 291 | | } |
| | 0 | 292 | | } |
| | | 293 | | |
| | | 294 | | /// <summary> |
| | | 295 | | /// An optional partial-method to perform custom initialization. |
| | | 296 | | ///</summary> |
| | | 297 | | partial void CustomInitialize(); |
| | | 298 | | /// <summary> |
| | | 299 | | /// Initializes client properties. |
| | | 300 | | /// </summary> |
| | | 301 | | private void Initialize() |
| | | 302 | | { |
| | 20 | 303 | | Metrics = new Metrics(this); |
| | 20 | 304 | | Events = new Events(this); |
| | 20 | 305 | | Query = new QueryOperations(this); |
| | 20 | 306 | | BaseUri = new System.Uri("https://api.applicationinsights.io/v1"); |
| | 20 | 307 | | SerializationSettings = new JsonSerializerSettings |
| | 20 | 308 | | { |
| | 20 | 309 | | Formatting = Newtonsoft.Json.Formatting.Indented, |
| | 20 | 310 | | DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, |
| | 20 | 311 | | DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, |
| | 20 | 312 | | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, |
| | 20 | 313 | | ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, |
| | 20 | 314 | | ContractResolver = new ReadOnlyJsonContractResolver(), |
| | 20 | 315 | | Converters = new List<JsonConverter> |
| | 20 | 316 | | { |
| | 20 | 317 | | new Iso8601TimeSpanConverter() |
| | 20 | 318 | | } |
| | 20 | 319 | | }; |
| | 20 | 320 | | DeserializationSettings = new JsonSerializerSettings |
| | 20 | 321 | | { |
| | 20 | 322 | | DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, |
| | 20 | 323 | | DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, |
| | 20 | 324 | | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, |
| | 20 | 325 | | ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, |
| | 20 | 326 | | ContractResolver = new ReadOnlyJsonContractResolver(), |
| | 20 | 327 | | Converters = new List<JsonConverter> |
| | 20 | 328 | | { |
| | 20 | 329 | | new Iso8601TimeSpanConverter() |
| | 20 | 330 | | } |
| | 20 | 331 | | }; |
| | 20 | 332 | | SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<EventsResultData>("type")); |
| | 20 | 333 | | DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<EventsResultData>("type")); |
| | 20 | 334 | | CustomInitialize(); |
| | 20 | 335 | | } |
| | | 336 | | } |
| | | 337 | | } |