/// <summary>Snippet for Validate</summary>
 public void Validate()
 {
     // Snippet: Validate(string, string, UrlMapsValidateRequest, CallSettings)
     // Create client
     UrlMapsClient urlMapsClient = UrlMapsClient.Create();
     // Initialize request argument(s)
     string project = "";
     string urlMap  = "";
     UrlMapsValidateRequest urlMapsValidateRequestResource = new UrlMapsValidateRequest();
     // Make the request
     UrlMapsValidateResponse response = urlMapsClient.Validate(project, urlMap, urlMapsValidateRequestResource);
     // End snippet
 }
        /// <summary>Snippet for ValidateAsync</summary>
        public async Task ValidateAsync()
        {
            // Snippet: ValidateAsync(string, string, UrlMapsValidateRequest, CallSettings)
            // Additional: ValidateAsync(string, string, UrlMapsValidateRequest, CancellationToken)
            // Create client
            UrlMapsClient urlMapsClient = await UrlMapsClient.CreateAsync();

            // Initialize request argument(s)
            string project = "";
            string urlMap  = "";
            UrlMapsValidateRequest urlMapsValidateRequestResource = new UrlMapsValidateRequest();
            // Make the request
            UrlMapsValidateResponse response = await urlMapsClient.ValidateAsync(project, urlMap, urlMapsValidateRequestResource);

            // End snippet
        }
Example #3
0
        /// <summary>
        /// Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.
        /// Documentation https://developers.google.com/compute/alpha/reference/urlMaps/validate
        /// 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 Compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="urlMap">Name of the UrlMap resource to be validated as.</param>
        /// <param name="body">A valid Compute alpha body.</param>
        /// <returns>UrlMapsValidateResponseResponse</returns>
        public static UrlMapsValidateResponse Validate(ComputeService service, string project, string urlMap, UrlMapsValidateRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (urlMap == null)
                {
                    throw new ArgumentNullException(urlMap);
                }

                // Make the request.
                return(service.UrlMaps.Validate(body, project, urlMap).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request UrlMaps.Validate failed.", ex);
            }
        }