コード例 #1
0
        /// <summary>
        /// Returns the list of customer feeds that match the query.
        ///
        /// @param query The SQL-like AWQL query string.
        /// @return A list of CustomerFeed.
        /// @throws ApiException If problems occur while parsing the query or fetching CustomerFeed.
        /// </summary>
        public async Task <CustomerFeedPage> QueryAsync(string query)
        {
            var binding = new CustomerFeedServiceSoapBinding("https://adwords.google.com/api/adwords/cm/v201609/CustomerFeedService", _config.AccessToken, _config.Timeout, _config.EnableGzipCompression, _netUtil, _logger);
            var inData  = new SoapData <CustomerFeedServiceRequestHeader, CustomerFeedServiceQuery>();

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

            return(outData.Body.Rval);
        }
コード例 #2
0
        /// <summary>
        /// Adds, sets, or removes customer feeds.
        ///
        /// @param operations The operations to apply.
        /// @return The resulting feeds.
        /// @throws ApiException Indicates a problem with the request.
        /// </summary>
        public async Task <CustomerFeedReturnValue> MutateAsync(IEnumerable <CustomerFeedOperation> operations)
        {
            var binding = new CustomerFeedServiceSoapBinding("https://adwords.google.com/api/adwords/cm/v201609/CustomerFeedService", _config.AccessToken, _config.Timeout, _config.EnableGzipCompression, _netUtil, _logger);
            var inData  = new SoapData <CustomerFeedServiceRequestHeader, CustomerFeedServiceMutate>();

            inData.Header = new CustomerFeedServiceRequestHeader();
            AssignHeaderValues(inData.Header);
            inData.Body            = new CustomerFeedServiceMutate();
            inData.Body.Operations = new List <CustomerFeedOperation>(operations);
            var outData = await binding.MutateAsync(inData).ConfigureAwait(false);

            return(outData.Body.Rval);
        }