Exemple #1
0
        /// <summary>
        /// Returns all the open/active BillingAccounts associated with the current
        /// manager.
        /// @return A list of {@link BillingAccount}s.
        /// @throws ApiException
        /// </summary>
        public async Task <IEnumerable <BillingAccount> > GetBillingAccountsAsync()
        {
            var binding = new BudgetOrderServiceSoapBinding("https://adwords.google.com/api/adwords/billing/v201609/BudgetOrderService", _config.AccessToken, _config.Timeout, _config.EnableGzipCompression, _netUtil, _logger);
            var inData  = new SoapData <BudgetOrderServiceRequestHeader, BudgetOrderServiceGetBillingAccounts>();

            inData.Header = new BudgetOrderServiceRequestHeader();
            AssignHeaderValues(inData.Header);
            inData.Body = new BudgetOrderServiceGetBillingAccounts();
            var outData = await binding.GetBillingAccountsAsync(inData).ConfigureAwait(false);

            return(outData.Body.Rval);
        }
Exemple #2
0
        /// <summary>
        /// Mutates BudgetOrders, supported operations are:
        /// <p><code>ADD</code>: Adds a {@link BudgetOrder} to the billing account
        /// specified by the billing account ID.</p>
        /// <p><code>SET</code>: Sets the start/end date and amount of the
        /// {@link BudgetOrder}.</p>
        /// <p><code>REMOVE</code>: Cancels the {@link BudgetOrder} (status change).</p>
        /// <p class="warning"><b>Warning:</b> The <code>BudgetOrderService</code>
        /// is limited to one operation per mutate request. Any attempt to make more
        /// than one operation will result in an <code>ApiException</code>.</p>
        /// @param operations A list of operations, <b>however currently we only
        /// support one operation per mutate call</b>.
        /// @return BudgetOrders affected by the mutate operation.
        /// @throws ApiException
        /// </summary>
        public async Task <BudgetOrderReturnValue> MutateAsync(IEnumerable <BudgetOrderOperation> operations)
        {
            var binding = new BudgetOrderServiceSoapBinding("https://adwords.google.com/api/adwords/billing/v201609/BudgetOrderService", _config.AccessToken, _config.Timeout, _config.EnableGzipCompression, _netUtil, _logger);
            var inData  = new SoapData <BudgetOrderServiceRequestHeader, BudgetOrderServiceMutate>();

            inData.Header = new BudgetOrderServiceRequestHeader();
            AssignHeaderValues(inData.Header);
            inData.Body            = new BudgetOrderServiceMutate();
            inData.Body.Operations = new List <BudgetOrderOperation>(operations);
            var outData = await binding.MutateAsync(inData).ConfigureAwait(false);

            return(outData.Body.Rval);
        }