/// <summary> /// Initializes a new instance of the <see cref="Insights"/> class. /// </summary> /// <param name="subscriptionId">The subscription identifier.</param> /// <param name="token">Valid JSON Web Token (JWT).</param> /// <exception cref="System.ArgumentNullException"> /// subscriptionId /// or /// token /// </exception> public Insights(string subscriptionId, string token) { subscriptionId.AssertNotEmpty(nameof(subscriptionId)); token.AssertNotEmpty(nameof(token)); this.client = new InsightsClient(new TokenCredentials(token)); this.subscriptionId = subscriptionId; }
/// <summary> /// Dispose the resources /// </summary> /// <param name="disposing">Indicates whether the managed resources should be disposed or not</param> protected virtual void Dispose(bool disposing) { if (!this.disposed) { if (this.insightsClient != null) { this.insightsClient.Dispose(); this.insightsClient = null; } this.disposed = true; } }
/// <summary> /// Dispose the resources /// </summary> /// <param name="disposing">Indicates whether the managed resources should be disposed or not</param> protected override void Dispose(bool disposing) { if (!this.disposed) { if (this.insightsClient != null) { this.insightsClient.Dispose(); this.insightsClient = null; } this.disposed = true; } base.Dispose(disposing); }