Пример #1
0
        /// <summary>
        /// Returns a DraftPage that contains a list of Draft objects matching the query.
        ///
        /// @throws {#link com.google.ads.api.services.common.error.ApiException} if problems occurred
        /// while retrieving the results.
        /// </summary>
        public async Task <DraftPage> QueryAsync(string query)
        {
            var binding = new DraftServiceSoapBinding("https://adwords.google.com/api/adwords/cm/v201609/DraftService", _config.AccessToken, _config.Timeout, _config.EnableGzipCompression, _netUtil, _logger);
            var inData  = new SoapData <DraftServiceRequestHeader, DraftServiceQuery>();

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

            return(outData.Body.Rval);
        }
Пример #2
0
        /// <summary>
        /// The mutate action is used for creating new Drafts and controlling the life cycle of Drafts,
        /// such as abandoning or promoting Drafts.
        ///
        /// @return The list of updated Drafts, in the same order as the {@code operations} list.
        /// @throws {#link com.google.ads.api.services.common.error.ApiException} if problems occurred
        /// while processing the request.
        /// </summary>
        public async Task <DraftReturnValue> MutateAsync(IEnumerable <DraftOperation> operations)
        {
            var binding = new DraftServiceSoapBinding("https://adwords.google.com/api/adwords/cm/v201609/DraftService", _config.AccessToken, _config.Timeout, _config.EnableGzipCompression, _netUtil, _logger);
            var inData  = new SoapData <DraftServiceRequestHeader, DraftServiceMutate>();

            inData.Header = new DraftServiceRequestHeader();
            AssignHeaderValues(inData.Header);
            inData.Body            = new DraftServiceMutate();
            inData.Body.Operations = new List <DraftOperation>(operations);
            var outData = await binding.MutateAsync(inData).ConfigureAwait(false);

            return(outData.Body.Rval);
        }