Example #1
0
        /// <summary>
        /// Returns the list of user lists that match the query.
        ///
        /// @param query The SQL-like AWQL query string
        /// @return A list of UserList
        /// @throws ApiException when the query is invalid or there are errors processing the request.
        /// </summary>
        public async Task <UserListPage> QueryAsync(string query)
        {
            var binding = new AdwordsUserListServiceSoapBinding("https://adwords.google.com/api/adwords/rm/v201609/AdwordsUserListService", _config.AccessToken, _config.Timeout, _config.EnableGzipCompression, _netUtil, _logger);
            var inData  = new SoapData <AdwordsUserListServiceRequestHeader, AdwordsUserListServiceQuery>();

            inData.Header = new AdwordsUserListServiceRequestHeader();
            AssignHeaderValues(inData.Header);
            inData.Body       = new AdwordsUserListServiceQuery();
            inData.Body.Query = query;
            var outData = await binding.QueryAsync(inData).ConfigureAwait(false);

            return(outData.Body.Rval);
        }
Example #2
0
        /// <summary>
        /// Mutate members of user lists by either adding or removing their lists of members.
        /// The following {@link Operator}s are supported: ADD and REMOVE.
        ///
        /// <p>Note that operations cannot have same user list id but different operators.
        ///
        /// @param operations the mutate members operations to apply
        /// @return a list of UserList objects
        /// @throws ApiException when there are one or more errors with the request
        /// </summary>
        public async Task <MutateMembersReturnValue> MutateMembersAsync(IEnumerable <MutateMembersOperation> operations)
        {
            var binding = new AdwordsUserListServiceSoapBinding("https://adwords.google.com/api/adwords/rm/v201609/AdwordsUserListService", _config.AccessToken, _config.Timeout, _config.EnableGzipCompression, _netUtil, _logger);
            var inData  = new SoapData <AdwordsUserListServiceRequestHeader, AdwordsUserListServiceMutateMembers>();

            inData.Header = new AdwordsUserListServiceRequestHeader();
            AssignHeaderValues(inData.Header);
            inData.Body            = new AdwordsUserListServiceMutateMembers();
            inData.Body.Operations = new List <MutateMembersOperation>(operations);
            var outData = await binding.MutateMembersAsync(inData).ConfigureAwait(false);

            return(outData.Body.Rval);
        }