示例#1
0
        /// <summary>
        /// Adds {@linkplain AccountLabel}s to, and removes
        /// {@linkplain AccountLabel}s from, {@linkplain ManagedCustomer}s.
        ///
        /// <p>To add an {@linkplain AccountLabel} to a {@linkplain ManagedCustomer},
        /// use {@link Operator#ADD}.
        /// To remove an {@linkplain AccountLabel} from a {@linkplain ManagedCustomer},
        /// use {@link Operator#REMOVE}.</p>
        /// <p>The label must already exist (see {@link AccountLabelService#mutate} for
        /// how to create them) and be owned by the authenticated user.</p>
        /// <p>The {@linkplain ManagedCustomer} must already exist and be managed by
        /// the customer making the request (either directly or indirectly).</p>
        /// <p>An AccountLabel may be applied to at most 1000 customers.</p>
        /// <p>This method does not support partial failures, and will fail if any
        /// operation is invalid.</p>
        /// </summary>
        public async Task <ManagedCustomerLabelReturnValue> MutateLabelAsync(IEnumerable <ManagedCustomerLabelOperation> operations)
        {
            var binding = new ManagedCustomerServiceSoapBinding("https://adwords.google.com/api/adwords/mcm/v201609/ManagedCustomerService", _config.AccessToken, _config.Timeout, _config.EnableGzipCompression, _netUtil, _logger);
            var inData  = new SoapData <ManagedCustomerServiceRequestHeader, ManagedCustomerServiceMutateLabel>();

            inData.Header = new ManagedCustomerServiceRequestHeader();
            AssignHeaderValues(inData.Header);
            inData.Body            = new ManagedCustomerServiceMutateLabel();
            inData.Body.Operations = new List <ManagedCustomerLabelOperation>(operations);
            var outData = await binding.MutateLabelAsync(inData).ConfigureAwait(false);

            return(outData.Body.Rval);
        }
示例#2
0
        /// <summary>
        /// Returns the pending invitations for the customer IDs in the selector.
        /// @param selector the manager customer ids (inviters) or the client customer ids (invitees)
        /// @throws ApiException when there is at least one error with the request
        /// </summary>
        public async Task <IEnumerable <PendingInvitation> > GetPendingInvitationsAsync(PendingInvitationSelector selector)
        {
            var binding = new ManagedCustomerServiceSoapBinding("https://adwords.google.com/api/adwords/mcm/v201609/ManagedCustomerService", _config.AccessToken, _config.Timeout, _config.EnableGzipCompression, _netUtil, _logger);
            var inData  = new SoapData <ManagedCustomerServiceRequestHeader, ManagedCustomerServiceGetPendingInvitations>();

            inData.Header = new ManagedCustomerServiceRequestHeader();
            AssignHeaderValues(inData.Header);
            inData.Body          = new ManagedCustomerServiceGetPendingInvitations();
            inData.Body.Selector = selector;
            var outData = await binding.GetPendingInvitationsAsync(inData).ConfigureAwait(false);

            return(outData.Body.Rval);
        }