コード例 #1
0
        /// <summary>
        /// Search for proposals using pql query
        /// Documentation https://developers.google.com/adexchangebuyer/v1.4/reference/proposals/search
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Adexchangebuyer service.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>GetOrdersResponseResponse</returns>
        public static GetOrdersResponse Search(AdexchangebuyerService service, ProposalsSearchOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Building the initial request.
                var request = service.Proposals.Search();

                // Applying optional parameters to the request.
                request = (ProposalsResource.SearchRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Proposals.Search failed.", ex);
            }
        }