/// <summary>Snippet for SetSslPolicy</summary> public void SetSslPolicy() { // Snippet: SetSslPolicy(string, string, SslPolicyReference, CallSettings) // Create client TargetHttpsProxiesClient targetHttpsProxiesClient = TargetHttpsProxiesClient.Create(); // Initialize request argument(s) string project = ""; string targetHttpsProxy = ""; SslPolicyReference sslPolicyReferenceResource = new SslPolicyReference(); // Make the request Operation response = targetHttpsProxiesClient.SetSslPolicy(project, targetHttpsProxy, sslPolicyReferenceResource); // End snippet }
/// <summary>Snippet for SetSslPolicyAsync</summary> public async Task SetSslPolicyAsync() { // Snippet: SetSslPolicyAsync(string, string, SslPolicyReference, CallSettings) // Additional: SetSslPolicyAsync(string, string, SslPolicyReference, CancellationToken) // Create client TargetHttpsProxiesClient targetHttpsProxiesClient = await TargetHttpsProxiesClient.CreateAsync(); // Initialize request argument(s) string project = ""; string targetHttpsProxy = ""; SslPolicyReference sslPolicyReferenceResource = new SslPolicyReference(); // Make the request Operation response = await targetHttpsProxiesClient.SetSslPolicyAsync(project, targetHttpsProxy, sslPolicyReferenceResource); // End snippet }
/// <summary> /// Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends. /// Documentation https://developers.google.com/compute/alpha/reference/targetSslProxies/setSslPolicy /// 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 SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035.</param> /// <param name="body">A valid Compute alpha body.</param> /// <param name="optional">Optional paramaters.</param> /// <returns>OperationResponse</returns> public static Operation SetSslPolicy(ComputeService service, string project, string targetSslProxy, SslPolicyReference body, TargetSslProxiesSetSslPolicyOptionalParms 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.SetSslPolicy(body, project, targetSslProxy); // Applying optional parameters to the request. request = (TargetSslProxiesResource.SetSslPolicyRequest)SampleHelpers.ApplyOptionalParms(request, optional); // Requesting data. return(request.Execute()); } catch (Exception ex) { throw new Exception("Request TargetSslProxies.SetSslPolicy failed.", ex); } }