public static void TestEditCustomHostnameAsync() { using var client = new CloudFlareClient(Credentials.Credentials.Authentication); var zoneId = client.GetZonesAsync().Result.Result.First().Id; var customHostname = client.GetCustomHostnamesAsync(zoneId).Result.Result.First(); var patchData = new PatchCustomHostname { Ssl = new CustomHostnameSsl { Method = MethodType.Http, Settings = new CustomHostnameSslSettings { Ciphers = new List <string> { "ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA" }, Http2 = FeatureStatus.On, MinTlsVersion = TlsVersion.Tls12, Tls13 = FeatureStatus.On }, } }; var editCustomHostname = client.EditCustomHostnameAsync(zoneId, customHostname.Id, patchData).Result; Assert.NotNull(editCustomHostname); Assert.Empty(editCustomHostname.Errors); Assert.True(editCustomHostname.Success); var updatedCustomHostname = client.GetCustomHostnamesAsync(zoneId, customHostname.Hostname).Result.Result.First(); Assert.Equal(MethodType.Http, updatedCustomHostname.Ssl.Method); }
public Task <CloudFlareResult <CustomHostname> > EditCustomHostnameAsync(string zoneId, string customHostnameId, PatchCustomHostname patchCustomHostname) { return(SendRequestAsync <CustomHostname>(_httpClient.PatchAsync( $"{ApiParameter.Endpoints.Zone.Base}/{zoneId}/{ApiParameter.Endpoints.CustomHostname.Base}/{customHostnameId}", CreatePatchContent(patchCustomHostname)))); }