From 813c95a82e0ee7e7a42553e6c6e7253070845700 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 28 Feb 2019 01:30:16 +0000 Subject: [PATCH] Generated from 8ee873d5b30f4242e9967ea63fa128155f0904a3 Enable SSL on custom domains using users certificate or CDN managed certificate --- .../cdn/CdnCertificateSourceParameters.java | 79 ++++++ .../cdn/CdnManagedHttpsParameters.java | 49 ++++ .../azure/management/cdn/CertificateType.java | 41 +++ .../cdn/CustomDomainHttpsParameters.java | 53 ++++ .../KeyVaultCertificateSourceParameters.java | 243 ++++++++++++++++++ .../azure/management/cdn/ProtocolType.java | 41 +++ .../cdn/UserManagedHttpsParameters.java | 49 ++++ .../implementation/CustomDomainsInner.java | 105 +++++++- 8 files changed, 658 insertions(+), 2 deletions(-) create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnCertificateSourceParameters.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnManagedHttpsParameters.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CertificateType.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainHttpsParameters.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/KeyVaultCertificateSourceParameters.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ProtocolType.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/UserManagedHttpsParameters.java diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnCertificateSourceParameters.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnCertificateSourceParameters.java new file mode 100644 index 000000000000..8953fb5ae70a --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnCertificateSourceParameters.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cdn; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines the parameters for using CDN managed certificate for securing custom + * domain. + */ +public class CdnCertificateSourceParameters { + /** + * The odatatype property. + */ + @JsonProperty(value = "@odata\\.type", required = true) + private String odatatype; + + /** + * Type of certificate used. Possible values include: 'Shared', + * 'Dedicated'. + */ + @JsonProperty(value = "certificateType", required = true) + private CertificateType certificateType; + + /** + * Creates an instance of CdnCertificateSourceParameters class. + * @param certificateType type of certificate used. Possible values include: 'Shared', 'Dedicated'. + */ + public CdnCertificateSourceParameters() { + odatatype = "#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters"; + } + + /** + * Get the odatatype value. + * + * @return the odatatype value + */ + public String odatatype() { + return this.odatatype; + } + + /** + * Set the odatatype value. + * + * @param odatatype the odatatype value to set + * @return the CdnCertificateSourceParameters object itself. + */ + public CdnCertificateSourceParameters withOdatatype(String odatatype) { + this.odatatype = odatatype; + return this; + } + + /** + * Get type of certificate used. Possible values include: 'Shared', 'Dedicated'. + * + * @return the certificateType value + */ + public CertificateType certificateType() { + return this.certificateType; + } + + /** + * Set type of certificate used. Possible values include: 'Shared', 'Dedicated'. + * + * @param certificateType the certificateType value to set + * @return the CdnCertificateSourceParameters object itself. + */ + public CdnCertificateSourceParameters withCertificateType(CertificateType certificateType) { + this.certificateType = certificateType; + return this; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnManagedHttpsParameters.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnManagedHttpsParameters.java new file mode 100644 index 000000000000..aa6c5008232c --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnManagedHttpsParameters.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cdn; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines the certificate source parameters using CDN managed certificate for + * enabling SSL. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "certificateSource") +@JsonTypeName("Cdn") +public class CdnManagedHttpsParameters extends CustomDomainHttpsParameters { + /** + * Defines the certificate source parameters using CDN managed certificate + * for enabling SSL. + */ + @JsonProperty(value = "certificateSourceParameters", required = true) + private CdnCertificateSourceParameters certificateSourceParameters; + + /** + * Get defines the certificate source parameters using CDN managed certificate for enabling SSL. + * + * @return the certificateSourceParameters value + */ + public CdnCertificateSourceParameters certificateSourceParameters() { + return this.certificateSourceParameters; + } + + /** + * Set defines the certificate source parameters using CDN managed certificate for enabling SSL. + * + * @param certificateSourceParameters the certificateSourceParameters value to set + * @return the CdnManagedHttpsParameters object itself. + */ + public CdnManagedHttpsParameters withCertificateSourceParameters(CdnCertificateSourceParameters certificateSourceParameters) { + this.certificateSourceParameters = certificateSourceParameters; + return this; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CertificateType.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CertificateType.java new file mode 100644 index 000000000000..095ee8d59c4b --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CertificateType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cdn; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CertificateType. + */ +public final class CertificateType extends ExpandableStringEnum { + /** Static value Shared for CertificateType. */ + public static final CertificateType SHARED = fromString("Shared"); + + /** Static value Dedicated for CertificateType. */ + public static final CertificateType DEDICATED = fromString("Dedicated"); + + /** + * Creates or finds a CertificateType from its string representation. + * @param name a name to look for + * @return the corresponding CertificateType + */ + @JsonCreator + public static CertificateType fromString(String name) { + return fromString(name, CertificateType.class); + } + + /** + * @return known CertificateType values + */ + public static Collection values() { + return values(CertificateType.class); + } +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainHttpsParameters.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainHttpsParameters.java new file mode 100644 index 000000000000..72662e8df6eb --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainHttpsParameters.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cdn; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The JSON object that contains the properties to secure a custom domain. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "certificateSource") +@JsonTypeName("CustomDomainHttpsParameters") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Cdn", value = CdnManagedHttpsParameters.class), + @JsonSubTypes.Type(name = "AzureKeyVault", value = UserManagedHttpsParameters.class) +}) +public class CustomDomainHttpsParameters { + /** + * Defines the TLS extension protocol that is used for secure delivery. + * Possible values include: 'ServerNameIndication', 'IPBased'. + */ + @JsonProperty(value = "protocolType", required = true) + private ProtocolType protocolType; + + /** + * Get defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased'. + * + * @return the protocolType value + */ + public ProtocolType protocolType() { + return this.protocolType; + } + + /** + * Set defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased'. + * + * @param protocolType the protocolType value to set + * @return the CustomDomainHttpsParameters object itself. + */ + public CustomDomainHttpsParameters withProtocolType(ProtocolType protocolType) { + this.protocolType = protocolType; + return this; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/KeyVaultCertificateSourceParameters.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/KeyVaultCertificateSourceParameters.java new file mode 100644 index 000000000000..c0e8b6928ef6 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/KeyVaultCertificateSourceParameters.java @@ -0,0 +1,243 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cdn; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for using a user's KeyVault certificate for + * securing custom domain. + */ +public class KeyVaultCertificateSourceParameters { + /** + * The odatatype property. + */ + @JsonProperty(value = "@odata\\.type", required = true) + private String odatatype; + + /** + * Subscription Id of the user's Key Vault containing the SSL certificate. + */ + @JsonProperty(value = "subscriptionId", required = true) + private String subscriptionId; + + /** + * Resource group of the user's Key Vault containing the SSL certificate. + */ + @JsonProperty(value = "resourceGroupName", required = true) + private String resourceGroupName; + + /** + * The name of the user's Key Vault containing the SSL certificate. + */ + @JsonProperty(value = "vaultName", required = true) + private String vaultName; + + /** + * The name of Key Vault Secret (representing the full certificate PFX) in + * Key Vault. + */ + @JsonProperty(value = "secretName", required = true) + private String secretName; + + /** + * The version(GUID) of Key Vault Secret in Key Vault. + */ + @JsonProperty(value = "secretVersion", required = true) + private String secretVersion; + + /** + * Describes the action that shall be taken when the certificate is updated + * in Key Vault. + */ + @JsonProperty(value = "updateRule", required = true) + private String updateRule; + + /** + * Describes the action that shall be taken when the certificate is removed + * from Key Vault. + */ + @JsonProperty(value = "deleteRule", required = true) + private String deleteRule; + + /** + * Creates an instance of KeyVaultCertificateSourceParameters class. + * @param subscriptionId subscription Id of the user's Key Vault containing the SSL certificate. + * @param resourceGroupName resource group of the user's Key Vault containing the SSL certificate. + * @param vaultName the name of the user's Key Vault containing the SSL certificate. + * @param secretName the name of Key Vault Secret (representing the full certificate PFX) in Key Vault. + * @param secretVersion the version(GUID) of Key Vault Secret in Key Vault. + */ + public KeyVaultCertificateSourceParameters() { + odatatype = "#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters"; + updateRule = "NoAction"; + deleteRule = "NoAction"; + } + + /** + * Get the odatatype value. + * + * @return the odatatype value + */ + public String odatatype() { + return this.odatatype; + } + + /** + * Set the odatatype value. + * + * @param odatatype the odatatype value to set + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withOdatatype(String odatatype) { + this.odatatype = odatatype; + return this; + } + + /** + * Get subscription Id of the user's Key Vault containing the SSL certificate. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set subscription Id of the user's Key Vault containing the SSL certificate. + * + * @param subscriptionId the subscriptionId value to set + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get resource group of the user's Key Vault containing the SSL certificate. + * + * @return the resourceGroupName value + */ + public String resourceGroupName() { + return this.resourceGroupName; + } + + /** + * Set resource group of the user's Key Vault containing the SSL certificate. + * + * @param resourceGroupName the resourceGroupName value to set + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withResourceGroupName(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + /** + * Get the name of the user's Key Vault containing the SSL certificate. + * + * @return the vaultName value + */ + public String vaultName() { + return this.vaultName; + } + + /** + * Set the name of the user's Key Vault containing the SSL certificate. + * + * @param vaultName the vaultName value to set + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withVaultName(String vaultName) { + this.vaultName = vaultName; + return this; + } + + /** + * Get the name of Key Vault Secret (representing the full certificate PFX) in Key Vault. + * + * @return the secretName value + */ + public String secretName() { + return this.secretName; + } + + /** + * Set the name of Key Vault Secret (representing the full certificate PFX) in Key Vault. + * + * @param secretName the secretName value to set + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withSecretName(String secretName) { + this.secretName = secretName; + return this; + } + + /** + * Get the version(GUID) of Key Vault Secret in Key Vault. + * + * @return the secretVersion value + */ + public String secretVersion() { + return this.secretVersion; + } + + /** + * Set the version(GUID) of Key Vault Secret in Key Vault. + * + * @param secretVersion the secretVersion value to set + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withSecretVersion(String secretVersion) { + this.secretVersion = secretVersion; + return this; + } + + /** + * Get describes the action that shall be taken when the certificate is updated in Key Vault. + * + * @return the updateRule value + */ + public String updateRule() { + return this.updateRule; + } + + /** + * Set describes the action that shall be taken when the certificate is updated in Key Vault. + * + * @param updateRule the updateRule value to set + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withUpdateRule(String updateRule) { + this.updateRule = updateRule; + return this; + } + + /** + * Get describes the action that shall be taken when the certificate is removed from Key Vault. + * + * @return the deleteRule value + */ + public String deleteRule() { + return this.deleteRule; + } + + /** + * Set describes the action that shall be taken when the certificate is removed from Key Vault. + * + * @param deleteRule the deleteRule value to set + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withDeleteRule(String deleteRule) { + this.deleteRule = deleteRule; + return this; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ProtocolType.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ProtocolType.java new file mode 100644 index 000000000000..2c040a57606f --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ProtocolType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cdn; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProtocolType. + */ +public final class ProtocolType extends ExpandableStringEnum { + /** Static value ServerNameIndication for ProtocolType. */ + public static final ProtocolType SERVER_NAME_INDICATION = fromString("ServerNameIndication"); + + /** Static value IPBased for ProtocolType. */ + public static final ProtocolType IPBASED = fromString("IPBased"); + + /** + * Creates or finds a ProtocolType from its string representation. + * @param name a name to look for + * @return the corresponding ProtocolType + */ + @JsonCreator + public static ProtocolType fromString(String name) { + return fromString(name, ProtocolType.class); + } + + /** + * @return known ProtocolType values + */ + public static Collection values() { + return values(ProtocolType.class); + } +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/UserManagedHttpsParameters.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/UserManagedHttpsParameters.java new file mode 100644 index 000000000000..39039dffa5b9 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/UserManagedHttpsParameters.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cdn; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines the certificate source parameters using user's keyvault certificate + * for enabling SSL. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "certificateSource") +@JsonTypeName("AzureKeyVault") +public class UserManagedHttpsParameters extends CustomDomainHttpsParameters { + /** + * Defines the certificate source parameters using user's keyvault + * certificate for enabling SSL. + */ + @JsonProperty(value = "certificateSourceParameters", required = true) + private KeyVaultCertificateSourceParameters certificateSourceParameters; + + /** + * Get defines the certificate source parameters using user's keyvault certificate for enabling SSL. + * + * @return the certificateSourceParameters value + */ + public KeyVaultCertificateSourceParameters certificateSourceParameters() { + return this.certificateSourceParameters; + } + + /** + * Set defines the certificate source parameters using user's keyvault certificate for enabling SSL. + * + * @param certificateSourceParameters the certificateSourceParameters value to set + * @return the UserManagedHttpsParameters object itself. + */ + public UserManagedHttpsParameters withCertificateSourceParameters(KeyVaultCertificateSourceParameters certificateSourceParameters) { + this.certificateSourceParameters = certificateSourceParameters; + return this; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CustomDomainsInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CustomDomainsInner.java index ec5dcc70c427..22276fc8a8f7 100644 --- a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CustomDomainsInner.java +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CustomDomainsInner.java @@ -12,6 +12,7 @@ import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.cdn.CustomDomainHttpsParameters; import com.microsoft.azure.management.cdn.CustomDomainParameters; import com.microsoft.azure.management.cdn.ErrorResponseException; import com.microsoft.azure.Page; @@ -19,6 +20,7 @@ import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; import java.io.IOException; import java.util.List; import okhttp3.ResponseBody; @@ -92,7 +94,7 @@ interface CustomDomainsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.CustomDomains enableCustomHttps" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps") - Observable> enableCustomHttps(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("customDomainName") String customDomainName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> enableCustomHttps(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("customDomainName") String customDomainName, @Path("subscriptionId") String subscriptionId, @Body CustomDomainHttpsParameters customDomainHttpsParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.CustomDomains listByEndpointNext" }) @GET @@ -899,7 +901,106 @@ public Observable> enableCustomHttpsWithServi if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.enableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final CustomDomainHttpsParameters customDomainHttpsParameters = null; + return service.enableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName, this.client.subscriptionId(), customDomainHttpsParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enableCustomHttpsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by default. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomDomainInner object if successful. + */ + public CustomDomainInner enableCustomHttps(String resourceGroupName, String profileName, String endpointName, String customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters) { + return enableCustomHttpsWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters).toBlocking().single().body(); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by default. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enableCustomHttpsAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableCustomHttpsWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters), serviceCallback); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by default. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainInner object + */ + public Observable enableCustomHttpsAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters) { + return enableCustomHttpsWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters).map(new Func1, CustomDomainInner>() { + @Override + public CustomDomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by default. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainInner object + */ + public Observable> enableCustomHttpsWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (customDomainName == null) { + throw new IllegalArgumentException("Parameter customDomainName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(customDomainHttpsParameters); + return service.enableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName, this.client.subscriptionId(), customDomainHttpsParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) {