/// <summary> /// Executes the operations associated with the cmdlet. /// </summary> public override void ExecuteCmdlet() { Scheduler.RunTask(async() => { IPartner partner = await PartnerSession.Instance.ClientFactory.CreatePartnerOperationsAsync(CorrelationId, CancellationToken).ConfigureAwait(false); CustomerUsageSummary usageSummary = await partner.Customers[CustomerId].UsageSummary.GetAsync(CancellationToken).ConfigureAwait(false); WriteObject(new PSCustomerUsageSummary(usageSummary)); }, true); }
/// <summary> /// Initializes a new instance of the <see cref="PSCustomerUsageSummary" /> class. /// </summary> /// <param name="summary">The base summary for the instance.</param> public PSCustomerUsageSummary(CustomerUsageSummary summary) { this.CopyFrom(summary, CloneAdditionalOperations); }
/// <summary> /// Additional operations to be performed when cloning an instance of <see cref="CustomerUsageSummary" /> to an instance of <see cref="PSCustomerUsageSummary" />. /// </summary> /// <param name="customerUsageSummary">The cart being cloned.</param> private void CloneAdditionalOperations(CustomerUsageSummary summary) { Budget = new PSSpendingBudget(summary.Budget); }
/// <summary> /// Initializes a new instance of the <see cref="PSCustomerUsageSummary" /> class. /// </summary> /// <param name="summary">The base summary for the instance.</param> public PSCustomerUsageSummary(CustomerUsageSummary summary) { this.CopyFrom(summary); }