/// <param name='operations'> /// Reference to the BillingWebJob.ICspUsage. /// </param> public static IList <CspAzureResourceUsageRecord> GetAllData(this ICspUsage operations) { return(Task.Factory.StartNew((object s) => { return ((ICspUsage)s).GetAllDataAsync(); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default) .Unwrap() .GetAwaiter() .GetResult()); }
/// <summary> /// Initializes a new instance of the AzureAnalyticsApi class. /// </summary> /// <param name='handlers'> /// Optional. The set of delegating handlers to insert in the http /// client pipeline. /// </param> public AzureAnalyticsApi(params DelegatingHandler[] handlers) : base(handlers) { this._cspBilling = new CspBilling(this); this._cspSummary = new CspSummary(this); this._cspUsage = new CspUsage(this); this._eaBilling = new EaBilling(this); this._userBilling = new UserBilling(this); this._baseUri = new Uri(ConfigurationManager.AppSettings["WebApiUrl"]); }
/// <param name='operations'> /// Reference to the BillingWebJob.ICspUsage. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> public static async Task <IList <CspAzureResourceUsageRecord> > GetAllDataAsync(this ICspUsage operations, CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Microsoft.Rest.HttpOperationResponse <System.Collections.Generic.IList <BillingWebJob.Models.CspAzureResourceUsageRecord> > result = await operations.GetAllDataWithOperationResponseAsync(cancellationToken).ConfigureAwait(false); return(result.Body); }
/// <summary> /// API which returns current month's usage records. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IList <CspAzureResourceUsageRecord> > GetAllDataAsync(this ICspUsage operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetAllDataWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }