Exemplo n.º 1
0
        /// <summary>
        /// Creates an advertiser lead for the given company ID.
        /// Documentation https://developers.google.com/partners/v2/reference/leads/create
        /// 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 partners service.</param>
        /// <param name="companyId">The ID of the company to contact.</param>
        /// <param name="body">A valid partners v2 body.</param>
        /// <returns>CreateLeadResponseResponse</returns>
        public static CreateLeadResponse Create(partnersService service, string companyId, CreateLeadRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (companyId == null)
                {
                    throw new ArgumentNullException(companyId);
                }

                // Make the request.
                return(service.Leads.Create(body, companyId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Leads.Create failed.", ex);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Logs a generic message from the client, such as `Failed to render component`, `Profile page is running slow`, `More than 500 users have accessed this result.`, etc.
        /// Documentation https://developers.google.com/partners/v2/reference/clientMessages/log
        /// 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 partners service.</param>
        /// <param name="body">A valid partners v2 body.</param>
        /// <returns>LogMessageResponseResponse</returns>
        public static LogMessageResponse Log(partnersService service, LogMessageRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }

                // Make the request.
                return(service.ClientMessages.Log(body).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request ClientMessages.Log failed.", ex);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Lists states for current user.
        /// Documentation https://developers.google.com/partners/v2/reference/userStates/list
        /// 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 partners service.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>ListUserStatesResponseResponse</returns>
        public static ListUserStatesResponse List(partnersService service, UserStatesListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Building the initial request.
                var request = service.UserStates.List();

                // Applying optional parameters to the request.
                request = (UserStatesResource.ListRequest)SampleHelpers.ApplyOptionalParms(request, optional);

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