/// <summary>Snippet for SetProxyHeader</summary>
 public void SetProxyHeader()
 {
     // Snippet: SetProxyHeader(string, string, TargetSslProxiesSetProxyHeaderRequest, CallSettings)
     // Create client
     TargetSslProxiesClient targetSslProxiesClient = TargetSslProxiesClient.Create();
     // Initialize request argument(s)
     string project        = "";
     string targetSslProxy = "";
     TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = new TargetSslProxiesSetProxyHeaderRequest();
     // Make the request
     Operation response = targetSslProxiesClient.SetProxyHeader(project, targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource);
     // End snippet
 }
        /// <summary>Snippet for SetProxyHeaderAsync</summary>
        public async Task SetProxyHeaderAsync()
        {
            // Snippet: SetProxyHeaderAsync(string, string, TargetSslProxiesSetProxyHeaderRequest, CallSettings)
            // Additional: SetProxyHeaderAsync(string, string, TargetSslProxiesSetProxyHeaderRequest, CancellationToken)
            // Create client
            TargetSslProxiesClient targetSslProxiesClient = await TargetSslProxiesClient.CreateAsync();

            // Initialize request argument(s)
            string project        = "";
            string targetSslProxy = "";
            TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = new TargetSslProxiesSetProxyHeaderRequest();
            // Make the request
            Operation response = await targetSslProxiesClient.SetProxyHeaderAsync(project, targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource);

            // End snippet
        }
コード例 #3
0
        /// <summary>
        /// Changes the ProxyHeaderType for TargetSslProxy.
        /// Documentation https://developers.google.com/compute/v1/reference/targetSslProxies/setProxyHeader
        /// 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="targetSslProxy">Name of the TargetSslProxy resource whose ProxyHeader is to be set.</param>
        /// <param name="body">A valid Compute v1 body.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>OperationResponse</returns>
        public static Operation SetProxyHeader(ComputeService service, string project, string targetSslProxy, TargetSslProxiesSetProxyHeaderRequest body, TargetSslProxiesSetProxyHeaderOptionalParms optional = null)
        {
            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 (targetSslProxy == null)
                {
                    throw new ArgumentNullException(targetSslProxy);
                }

                // Building the initial request.
                var request = service.TargetSslProxies.SetProxyHeader(body, project, targetSslProxy);

                // Applying optional parameters to the request.
                request = (TargetSslProxiesResource.SetProxyHeaderRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request TargetSslProxies.SetProxyHeader failed.", ex);
            }
        }
コード例 #4
0
        /// <summary>
        /// Changes the ProxyHeaderType for TargetSslProxy.
        /// Documentation https://developers.google.com/compute/alpha/reference/targetSslProxies/setProxyHeader
        /// 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="targetSslProxy">Name of the TargetSslProxy resource whose ProxyHeader is to be set.</param>
        /// <param name="body">A valid compute alpha body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation SetProxyHeader(computeService service, string project, string targetSslProxy, TargetSslProxiesSetProxyHeaderRequest 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 (targetSslProxy == null)
                {
                    throw new ArgumentNullException(targetSslProxy);
                }

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