/// <summary>
        /// Executes the operations associated with the cmdlet.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            Scheduler.RunTask(async() =>
            {
                IBillingManagementClient client = await PartnerSession.Instance.ClientFactory.CreateServiceClientAsync <BillingManagementClient>(new[] { $"{PartnerSession.Instance.Context.Environment.AzureEndpoint}/user_impersonation" });

                WriteObject(client.Policies.GetByCustomerAsync(BillingAccountName, CustomerId, CancellationToken).ConfigureAwait(false).GetAwaiter().GetResult());
            }, true);
        }
示例#2
0
        /// <summary>
        /// Executes the operations associated with the cmdlet.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            Scheduler.RunTask(async() =>
            {
                IBillingManagementClient client = await PartnerSession.Instance.ClientFactory.CreateServiceClientAsync <BillingManagementClient>(new[] { $"{PartnerSession.Instance.Context.Environment.AzureEndpoint}/user_impersonation" }).ConfigureAwait(false);
                BillingAccountListResult data   = await client.BillingAccounts.ListAsync(null, CancellationToken).ConfigureAwait(false);

                WriteObject(data.Value, true);
            }, true);
        }
示例#3
0
        /// <summary>
        /// Executes the operations associated with the cmdlet.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            Scheduler.RunTask(async() =>
            {
                IBillingManagementClient client = await PartnerSession.Instance.ClientFactory.CreateServiceClientAsync <BillingManagementClient>(new[] { $"{PartnerSession.Instance.Context.Environment.AzureEndpoint}/user_impersonation" });

                WriteObject(await client.Policies.UpdateCustomerAsync(
                                BillingAccountName,
                                CustomerId,
                                new CustomerPolicy
                {
                    ViewCharges = ViewCharges.ToBool() ? AllowedValue : NotAllowedValue
                },
                                CancellationToken).ConfigureAwait(false));
            }, true);
        }
 /// <summary>
 /// Cancel auto renew for product by product id
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='billingAccountName'>
 /// billing Account Id.
 /// </param>
 /// <param name='invoiceSectionName'>
 /// InvoiceSection Id.
 /// </param>
 /// <param name='productName'>
 /// Invoice Id.
 /// </param>
 /// <param name='body'>
 /// Update auto renew request parameters.
 /// </param>
 public static UpdateAutoRenewOperationSummary UpdateAutoRenewForInvoiceSection(this IBillingManagementClient operations, string billingAccountName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body)
 {
     return(operations.UpdateAutoRenewForInvoiceSectionAsync(billingAccountName, invoiceSectionName, productName, body).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Cancel product by product id
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='billingAccountName'>
 /// billing Account Id.
 /// </param>
 /// <param name='productName'>
 /// Invoice Id.
 /// </param>
 /// <param name='body'>
 /// Update auto renew request parameters.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <UpdateAutoRenewOperationSummary> UpdateAutoRenewForBillingAccountAsync(this IBillingManagementClient operations, string billingAccountName, string productName, UpdateAutoRenewRequest body, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateAutoRenewForBillingAccountWithHttpMessagesAsync(billingAccountName, productName, body, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Lists the transactions by billingProfileName for given start date and end
 /// date.
 /// <see href="https://docs.microsoft.com/en-us/rest/api/consumption/" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='billingAccountName'>
 /// billing Account Id.
 /// </param>
 /// <param name='billingProfileName'>
 /// Billing Profile Id.
 /// </param>
 /// <param name='startDate'>
 /// Start date
 /// </param>
 /// <param name='endDate'>
 /// End date
 /// </param>
 /// <param name='filter'>
 /// May be used to filter by transaction kind. The filter supports 'eq', 'lt',
 /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or
 /// 'not'. Tag filter is a key value pair string where key and value is
 /// separated by a colon (:).
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <TransactionsListResult> TransactionsByBillingProfileAsync(this IBillingManagementClient operations, string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.TransactionsByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, startDate, endDate, filter, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Lists the transactions by billingProfileName for given start date and end
 /// date.
 /// <see href="https://docs.microsoft.com/en-us/rest/api/consumption/" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='billingAccountName'>
 /// billing Account Id.
 /// </param>
 /// <param name='billingProfileName'>
 /// Billing Profile Id.
 /// </param>
 /// <param name='startDate'>
 /// Start date
 /// </param>
 /// <param name='endDate'>
 /// End date
 /// </param>
 /// <param name='filter'>
 /// May be used to filter by transaction kind. The filter supports 'eq', 'lt',
 /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or
 /// 'not'. Tag filter is a key value pair string where key and value is
 /// separated by a colon (:).
 /// </param>
 public static TransactionsListResult TransactionsByBillingProfile(this IBillingManagementClient operations, string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string))
 {
     return(operations.TransactionsByBillingProfileAsync(billingAccountName, billingProfileName, startDate, endDate, filter).GetAwaiter().GetResult());
 }