From 1974b8a329e94c7b65fc4365d2d6c2fc36f1f468 Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Mon, 14 Mar 2016 16:25:48 -0700 Subject: [PATCH] Add overloads without optional parameters --- ...rtualMachineExtensionImagesOperations.java | 24 + ...lMachineExtensionImagesOperationsImpl.java | 86 + .../VirtualMachineExtensionsOperations.java | 24 + ...irtualMachineExtensionsOperationsImpl.java | 82 + .../VirtualMachineImagesOperations.java | 26 + .../VirtualMachineImagesOperationsImpl.java | 95 + .../VirtualMachineScaleSetVMsOperations.java | 22 + ...rtualMachineScaleSetVMsOperationsImpl.java | 90 + .../VirtualMachineScaleSetsOperations.java | 180 + ...VirtualMachineScaleSetsOperationsImpl.java | 770 +- .../compute/VirtualMachinesOperations.java | 22 + .../VirtualMachinesOperationsImpl.java | 73 + .../network/LoadBalancersOperations.java | 22 + .../network/LoadBalancersOperationsImpl.java | 73 + .../network/NetworkInterfacesOperations.java | 48 + .../NetworkInterfacesOperationsImpl.java | 164 + .../network/NetworkManagementClient.java | 20 + .../network/NetworkManagementClientImpl.java | 64 + .../NetworkSecurityGroupsOperations.java | 22 + .../NetworkSecurityGroupsOperationsImpl.java | 73 + .../network/PublicIPAddressesOperations.java | 22 + .../PublicIPAddressesOperationsImpl.java | 73 + .../network/RouteTablesOperations.java | 22 + .../network/RouteTablesOperationsImpl.java | 73 + .../management/network/SubnetsOperations.java | 24 + .../network/SubnetsOperationsImpl.java | 82 + ...alNetworkGatewayConnectionsOperations.java | 90 + ...tworkGatewayConnectionsOperationsImpl.java | 300 + .../VirtualNetworkGatewaysOperations.java | 22 + .../VirtualNetworkGatewaysOperationsImpl.java | 77 + .../network/VirtualNetworksOperations.java | 22 + .../VirtualNetworksOperationsImpl.java | 73 + .../DeploymentOperationsOperations.java | 22 + .../DeploymentOperationsOperationsImpl.java | 86 + .../resources/DeploymentsOperations.java | 20 + .../resources/DeploymentsOperationsImpl.java | 79 + .../PolicyAssignmentsOperations.java | 86 + .../PolicyAssignmentsOperationsImpl.java | 335 + .../ProviderOperationsMetadataOperations.java | 42 + ...viderOperationsMetadataOperationsImpl.java | 122 + .../resources/ProvidersOperations.java | 18 + .../resources/ProvidersOperationsImpl.java | 68 + .../resources/ResourceGroupsOperations.java | 38 + .../ResourceGroupsOperationsImpl.java | 149 + .../resources/ResourcesOperations.java | 18 + .../resources/ResourcesOperationsImpl.java | 70 + .../resources/RoleAssignmentsOperations.java | 86 + .../RoleAssignmentsOperationsImpl.java | 328 + .../resources/RoleDefinitionsOperations.java | 20 + .../RoleDefinitionsOperationsImpl.java | 70 + .../ResourceGroupsOperationsTests.java | 2 +- .../storage/StorageAccountsOperations.java | 20 + .../StorageAccountsOperationsImpl.java | 70 + .../management/website/DomainsOperations.java | 22 + .../website/DomainsOperationsImpl.java | 73 + .../GlobalDomainRegistrationOperations.java | 18 + ...lobalDomainRegistrationOperationsImpl.java | 59 + .../management/website/GlobalOperations.java | 18 + .../website/GlobalOperationsImpl.java | 55 + .../HostingEnvironmentsOperations.java | 207 + .../HostingEnvironmentsOperationsImpl.java | 733 +- .../ManagedHostingEnvironmentsOperations.java | 67 + ...agedHostingEnvironmentsOperationsImpl.java | 215 + .../website/RecommendationsOperations.java | 62 + .../RecommendationsOperationsImpl.java | 205 + .../website/ServerFarmsOperations.java | 115 + .../website/ServerFarmsOperationsImpl.java | 401 + .../management/website/SitesOperations.java | 440 + .../website/SitesOperationsImpl.java | 7062 ++++++++++------- .../website/TopLevelDomainsOperations.java | 20 + .../TopLevelDomainsOperationsImpl.java | 68 + 71 files changed, 11607 insertions(+), 2842 deletions(-) diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImagesOperations.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImagesOperations.java index 91ba253af38b..d1e18b0aa7db 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImagesOperations.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImagesOperations.java @@ -74,6 +74,30 @@ public interface VirtualMachineExtensionImagesOperations { */ ServiceCall listTypesAsync(String location, String publisherName, final ServiceCallback> serviceCallback) throws IllegalArgumentException; + /** + * Gets a list of virtual machine extension image versions. + * + * @param location the String value + * @param publisherName the String value + * @param type the String value + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<VirtualMachineImageResource> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listVersions(String location, String publisherName, String type) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location the String value + * @param publisherName the String value + * @param type the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listVersionsAsync(String location, String publisherName, String type, final ServiceCallback> serviceCallback) throws IllegalArgumentException; /** * Gets a list of virtual machine extension image versions. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImagesOperationsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImagesOperationsImpl.java index f5fc1900ea02..a651064ada09 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImagesOperationsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImagesOperationsImpl.java @@ -246,6 +246,92 @@ private ServiceResponse> listTypesDelegate(Res .build(response); } + /** + * Gets a list of virtual machine extension image versions. + * + * @param location the String value + * @param publisherName the String value + * @param type the String value + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<VirtualMachineImageResource> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listVersions(String location, String publisherName, String type) throws CloudException, IOException, IllegalArgumentException { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (publisherName == null) { + throw new IllegalArgumentException("Parameter publisherName is required and cannot be null."); + } + if (type == null) { + throw new IllegalArgumentException("Parameter type is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + VirtualMachineImageResource filter = null; + Integer top = null; + String orderby = null; + Call call = service.listVersions(location, publisherName, type, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, orderby, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return listVersionsDelegate(call.execute()); + } + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location the String value + * @param publisherName the String value + * @param type the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listVersionsAsync(String location, String publisherName, String type, final ServiceCallback> serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (location == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter location is required and cannot be null.")); + return null; + } + if (publisherName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + return null; + } + if (type == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter type is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final VirtualMachineImageResource filter = null; + final Integer top = null; + final String orderby = null; + Call call = service.listVersions(location, publisherName, type, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, orderby, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(listVersionsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets a list of virtual machine extension image versions. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionsOperations.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionsOperations.java index 4130b64bc346..f6246f41a7ab 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionsOperations.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionsOperations.java @@ -128,6 +128,30 @@ public interface VirtualMachineExtensionsOperations { */ ServiceCall beginDeleteAsync(String resourceGroupName, String vmName, String vmExtensionName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the VirtualMachineExtension object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse get(String resourceGroupName, String vmName, String vmExtensionName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAsync(String resourceGroupName, String vmName, String vmExtensionName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The operation to get the extension. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionsOperationsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionsOperationsImpl.java index 90749c827225..a61049fd4fae 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionsOperationsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionsOperationsImpl.java @@ -431,6 +431,88 @@ private ServiceResponse beginDeleteDelegate(Response respons .build(response); } + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the VirtualMachineExtension object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse get(String resourceGroupName, String vmName, String vmExtensionName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmName == null) { + throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); + } + if (vmExtensionName == null) { + throw new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String expand = null; + Call call = service.get(resourceGroupName, vmName, vmExtensionName, this.client.getSubscriptionId(), expand, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getDelegate(call.execute()); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAsync(String resourceGroupName, String vmName, String vmExtensionName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (vmName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + return null; + } + if (vmExtensionName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String expand = null; + Call call = service.get(resourceGroupName, vmName, vmExtensionName, this.client.getSubscriptionId(), expand, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The operation to get the extension. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineImagesOperations.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineImagesOperations.java index 50fe1b94b83f..ff850b0d75ac 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineImagesOperations.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineImagesOperations.java @@ -53,6 +53,32 @@ public interface VirtualMachineImagesOperations { */ ServiceCall getAsync(String location, String publisherName, String offer, String skus, String version, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets a list of virtual machine images. + * + * @param location the String value + * @param publisherName the String value + * @param offer the String value + * @param skus the String value + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<VirtualMachineImageResource> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list(String location, String publisherName, String offer, String skus) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets a list of virtual machine images. + * + * @param location the String value + * @param publisherName the String value + * @param offer the String value + * @param skus the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(String location, String publisherName, String offer, String skus, final ServiceCallback> serviceCallback) throws IllegalArgumentException; /** * Gets a list of virtual machine images. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineImagesOperationsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineImagesOperationsImpl.java index c21f446c8eae..8ea85b4470b1 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineImagesOperationsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineImagesOperationsImpl.java @@ -185,6 +185,101 @@ private ServiceResponse getDelegate(Response .build(response); } + /** + * Gets a list of virtual machine images. + * + * @param location the String value + * @param publisherName the String value + * @param offer the String value + * @param skus the String value + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<VirtualMachineImageResource> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list(String location, String publisherName, String offer, String skus) throws CloudException, IOException, IllegalArgumentException { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (publisherName == null) { + throw new IllegalArgumentException("Parameter publisherName is required and cannot be null."); + } + if (offer == null) { + throw new IllegalArgumentException("Parameter offer is required and cannot be null."); + } + if (skus == null) { + throw new IllegalArgumentException("Parameter skus is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + VirtualMachineImageResource filter = null; + Integer top = null; + String orderby = null; + Call call = service.list(location, publisherName, offer, skus, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, orderby, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return listDelegate(call.execute()); + } + + /** + * Gets a list of virtual machine images. + * + * @param location the String value + * @param publisherName the String value + * @param offer the String value + * @param skus the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(String location, String publisherName, String offer, String skus, final ServiceCallback> serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (location == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter location is required and cannot be null.")); + return null; + } + if (publisherName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + return null; + } + if (offer == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter offer is required and cannot be null.")); + return null; + } + if (skus == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter skus is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final VirtualMachineImageResource filter = null; + final Integer top = null; + final String orderby = null; + Call call = service.list(location, publisherName, offer, skus, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, orderby, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(listDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets a list of virtual machine images. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMsOperations.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMsOperations.java index 8744668cb5d8..93091c07a21c 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMsOperations.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMsOperations.java @@ -229,6 +229,28 @@ public interface VirtualMachineScaleSetVMsOperations { */ ServiceCall getInstanceViewAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The operation to list virtual machine scale sets VMs. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<VirtualMachineScaleSetVM> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list(final String resourceGroupName, final String virtualMachineScaleSetName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The operation to list virtual machine scale sets VMs. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * The operation to list virtual machine scale sets VMs. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMsOperationsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMsOperationsImpl.java index aaf6bd271fa3..4762cc9b50e3 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMsOperationsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMsOperationsImpl.java @@ -792,6 +792,96 @@ private ServiceResponse getInstanceViewDel .build(response); } + /** + * The operation to list virtual machine scale sets VMs. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<VirtualMachineScaleSetVM> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list(final String resourceGroupName, final String virtualMachineScaleSetName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + VirtualMachineScaleSetVM filter = null; + String select = null; + String expand = null; + Call call = service.list(resourceGroupName, virtualMachineScaleSetName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), select, expand, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * The operation to list virtual machine scale sets VMs. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (virtualMachineScaleSetName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final VirtualMachineScaleSetVM filter = null; + final String select = null; + final String expand = null; + Call call = service.list(resourceGroupName, virtualMachineScaleSetName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), select, expand, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The operation to list virtual machine scale sets VMs. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetsOperations.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetsOperations.java index 26ecb0661d57..4e59732d0dab 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetsOperations.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetsOperations.java @@ -78,6 +78,29 @@ public interface VirtualMachineScaleSetsOperations { */ ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String name, VirtualMachineScaleSet parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The operation to deallocate virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse deallocate(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * The operation to deallocate virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall deallocateAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The operation to deallocate virtual machines in a virtual machine scale set. * @@ -104,6 +127,28 @@ public interface VirtualMachineScaleSetsOperations { */ ServiceCall deallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The operation to deallocate virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse beginDeallocate(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The operation to deallocate virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The operation to deallocate virtual machines in a virtual machine scale set. * @@ -336,6 +381,29 @@ public interface VirtualMachineScaleSetsOperations { */ ServiceCall listSkusAsync(final String resourceGroupName, final String vmScaleSetName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * The operation to power off (stop) virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse powerOff(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * The operation to power off (stop) virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall powerOffAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The operation to power off (stop) virtual machines in a virtual machine scale set. * @@ -362,6 +430,28 @@ public interface VirtualMachineScaleSetsOperations { */ ServiceCall powerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The operation to power off (stop) virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse beginPowerOff(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The operation to power off (stop) virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The operation to power off (stop) virtual machines in a virtual machine scale set. * @@ -387,6 +477,29 @@ public interface VirtualMachineScaleSetsOperations { */ ServiceCall beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The operation to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse restart(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * The operation to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall restartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The operation to restart virtual machines in a virtual machine scale set. * @@ -413,6 +526,28 @@ public interface VirtualMachineScaleSetsOperations { */ ServiceCall restartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The operation to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse beginRestart(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The operation to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginRestartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The operation to restart virtual machines in a virtual machine scale set. * @@ -438,6 +573,29 @@ public interface VirtualMachineScaleSetsOperations { */ ServiceCall beginRestartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The operation to start virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse start(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * The operation to start virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall startAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The operation to start virtual machines in a virtual machine scale set. * @@ -464,6 +622,28 @@ public interface VirtualMachineScaleSetsOperations { */ ServiceCall startAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The operation to start virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse beginStart(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The operation to start virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginStartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The operation to start virtual machines in a virtual machine scale set. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetsOperationsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetsOperationsImpl.java index c3ecea5c50be..80ccb0f8091a 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetsOperationsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetsOperationsImpl.java @@ -343,6 +343,85 @@ private ServiceResponse beginCreateOrUpdateDelegate(Resp .build(response); } + /** + * The operation to deallocate virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the ServiceResponse object if successful. + */ + public ServiceResponse deallocate(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + final List instanceIds = null; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Response result = service.deallocate(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs).execute(); + return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); + } + + /** + * The operation to deallocate virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall deallocateAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + final List instanceIds = null; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Call call = service.deallocate(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } /** * The operation to deallocate virtual machines in a virtual machine scale set. * @@ -425,6 +504,89 @@ public void onResponse(Call call, Response response) return serviceCall; } + /** + * The operation to deallocate virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse beginDeallocate(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + List instanceIds = null; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Call call = service.beginDeallocate(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + return beginDeallocateDelegate(call.execute()); + } + + /** + * The operation to deallocate virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (vmScaleSetName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final List instanceIds = null; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Call call = service.beginDeallocate(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginDeallocateDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The operation to deallocate virtual machines in a virtual machine scale set. * @@ -1244,14 +1406,13 @@ private ServiceResponse> listSkusDelegate(Re * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set. - * @param instanceIds Gets or sets the virtual machine scale set instance ids. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted * @return the ServiceResponse object if successful. */ - public ServiceResponse powerOff(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + public ServiceResponse powerOff(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1264,7 +1425,7 @@ public ServiceResponse powerOff(String resourceGroupName, String vmScaleSe if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(instanceIds); + final List instanceIds = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); @@ -1279,12 +1440,11 @@ public ServiceResponse powerOff(String resourceGroupName, String vmScaleSe * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set. - * @param instanceIds Gets or sets the virtual machine scale set instance ids. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link ServiceCall} object */ - public ServiceCall powerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall powerOffAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -1300,7 +1460,7 @@ public ServiceCall powerOffAsync(String resourceGroupName, String vmScaleSetName if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); } - Validator.validate(instanceIds, serviceCallback); + final List instanceIds = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); @@ -1320,7 +1480,6 @@ public void onResponse(Call call, Response response) }); return serviceCall; } - /** * The operation to power off (stop) virtual machines in a virtual machine scale set. * @@ -1330,9 +1489,10 @@ public void onResponse(Call call, Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the ServiceResponse object if successful. */ - public ServiceResponse beginPowerOff(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse powerOff(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1351,8 +1511,8 @@ public ServiceResponse beginPowerOff(String resourceGroupName, String vmSc vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.setInstanceIds(instanceIds); } - Call call = service.beginPowerOff(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); - return beginPowerOffDelegate(call.execute()); + Response result = service.powerOff(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs).execute(); + return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); } /** @@ -1363,27 +1523,23 @@ public ServiceResponse beginPowerOff(String resourceGroupName, String vmSc * @param instanceIds Gets or sets the virtual machine scale set instance ids. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null - * @return the {@link Call} object + * @return the {@link ServiceCall} object */ - public ServiceCall beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall powerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } if (resourceGroupName == null) { serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - return null; } if (vmScaleSetName == null) { serviceCallback.failure(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); - return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); - return null; } Validator.validate(instanceIds, serviceCallback); VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; @@ -1391,40 +1547,32 @@ public ServiceCall beginPowerOffAsync(String resourceGroupName, String vmScaleSe vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.setInstanceIds(instanceIds); } - Call call = service.beginPowerOff(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + Call call = service.powerOff(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } @Override public void onResponse(Call call, Response response) { - try { - serviceCallback.success(beginPowerOffDelegate(response)); - } catch (CloudException | IOException exception) { - serviceCallback.failure(exception); - } + client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); } }); return serviceCall; } - private ServiceResponse beginPowerOffDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(202, new TypeToken() { }.getType()) - .build(response); - } - /** - * The operation to restart virtual machines in a virtual machine scale set. + * The operation to power off (stop) virtual machines in a virtual machine scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set. - * @param instanceIds Gets or sets the virtual machine scale set instance ids. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. + * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse restart(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + public ServiceResponse beginPowerOff(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1437,65 +1585,68 @@ public ServiceResponse restart(String resourceGroupName, String vmScaleSet if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(instanceIds); + List instanceIds = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.setInstanceIds(instanceIds); } - Response result = service.restart(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs).execute(); - return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); + Call call = service.beginPowerOff(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + return beginPowerOffDelegate(call.execute()); } /** - * The operation to restart virtual machines in a virtual machine scale set. + * The operation to power off (stop) virtual machines in a virtual machine scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set. - * @param instanceIds Gets or sets the virtual machine scale set instance ids. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null - * @return the {@link ServiceCall} object + * @return the {@link Call} object */ - public ServiceCall restartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } if (resourceGroupName == null) { serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; } if (vmScaleSetName == null) { serviceCallback.failure(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; } - Validator.validate(instanceIds, serviceCallback); + final List instanceIds = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.setInstanceIds(instanceIds); } - Call call = service.restart(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + Call call = service.beginPowerOff(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new Callback() { - @Override - public void onFailure(Call call, Throwable t) { - serviceCallback.failure(t); - } + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { - client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + try { + serviceCallback.success(beginPowerOffDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } } }); return serviceCall; } /** - * The operation to restart virtual machines in a virtual machine scale set. + * The operation to power off (stop) virtual machines in a virtual machine scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set. @@ -1505,7 +1656,7 @@ public void onResponse(Call call, Response response) * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginRestart(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse beginPowerOff(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1524,12 +1675,12 @@ public ServiceResponse beginRestart(String resourceGroupName, String vmSca vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.setInstanceIds(instanceIds); } - Call call = service.beginRestart(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); - return beginRestartDelegate(call.execute()); + Call call = service.beginPowerOff(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + return beginPowerOffDelegate(call.execute()); } /** - * The operation to restart virtual machines in a virtual machine scale set. + * The operation to power off (stop) virtual machines in a virtual machine scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set. @@ -1538,7 +1689,7 @@ public ServiceResponse beginRestart(String resourceGroupName, String vmSca * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall beginRestartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -1564,13 +1715,13 @@ public ServiceCall beginRestartAsync(String resourceGroupName, String vmScaleSet vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.setInstanceIds(instanceIds); } - Call call = service.beginRestart(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + Call call = service.beginPowerOff(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(beginRestartDelegate(response)); + serviceCallback.success(beginPowerOffDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -1579,18 +1730,432 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse beginRestartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginPowerOffDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) .register(202, new TypeToken() { }.getType()) .build(response); } /** - * The operation to start virtual machines in a virtual machine scale set. + * The operation to restart virtual machines in a virtual machine scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set. - * @param instanceIds Gets or sets the virtual machine scale set instance ids. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the ServiceResponse object if successful. + */ + public ServiceResponse restart(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + final List instanceIds = null; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Response result = service.restart(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs).execute(); + return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); + } + + /** + * The operation to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall restartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + final List instanceIds = null; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Call call = service.restart(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } + /** + * The operation to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds Gets or sets the virtual machine scale set instance ids. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the ServiceResponse object if successful. + */ + public ServiceResponse restart(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(instanceIds); + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Response result = service.restart(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs).execute(); + return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); + } + + /** + * The operation to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds Gets or sets the virtual machine scale set instance ids. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall restartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + Validator.validate(instanceIds, serviceCallback); + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Call call = service.restart(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } + + /** + * The operation to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse beginRestart(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + List instanceIds = null; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Call call = service.beginRestart(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + return beginRestartDelegate(call.execute()); + } + + /** + * The operation to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginRestartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (vmScaleSetName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final List instanceIds = null; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Call call = service.beginRestart(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginRestartDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * The operation to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds Gets or sets the virtual machine scale set instance ids. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse beginRestart(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(instanceIds); + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Call call = service.beginRestart(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + return beginRestartDelegate(call.execute()); + } + + /** + * The operation to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds Gets or sets the virtual machine scale set instance ids. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginRestartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (vmScaleSetName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(instanceIds, serviceCallback); + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Call call = service.beginRestart(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginRestartDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse beginRestartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(202, new TypeToken() { }.getType()) + .build(response); + } + + /** + * The operation to start virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the ServiceResponse object if successful. + */ + public ServiceResponse start(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + final List instanceIds = null; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Response result = service.start(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs).execute(); + return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); + } + + /** + * The operation to start virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall startAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + final List instanceIds = null; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Call call = service.start(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } + /** + * The operation to start virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds Gets or sets the virtual machine scale set instance ids. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters @@ -1667,6 +2232,89 @@ public void onResponse(Call call, Response response) return serviceCall; } + /** + * The operation to start virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse beginStart(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + List instanceIds = null; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Call call = service.beginStart(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + return beginStartDelegate(call.execute()); + } + + /** + * The operation to start virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginStartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (vmScaleSetName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final List instanceIds = null; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + if (instanceIds != null) { + vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDs.setInstanceIds(instanceIds); + } + Call call = service.beginStart(resourceGroupName, vmScaleSetName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), vmInstanceIDs); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginStartDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The operation to start virtual machines in a virtual machine scale set. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinesOperations.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinesOperations.java index 7f8a566917a1..9ede9db46f2e 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinesOperations.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinesOperations.java @@ -177,6 +177,28 @@ public interface VirtualMachinesOperations { */ ServiceCall beginDeleteAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The operation to get a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the VirtualMachine object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse get(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The operation to get a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The operation to get a virtual machine. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinesOperationsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinesOperationsImpl.java index 2a585b5e1b3b..b5848d3eef88 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinesOperationsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinesOperationsImpl.java @@ -649,6 +649,79 @@ private ServiceResponse beginDeleteDelegate(Response respons .build(response); } + /** + * The operation to get a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the VirtualMachine object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse get(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmName == null) { + throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String expand = null; + Call call = service.get(resourceGroupName, vmName, this.client.getSubscriptionId(), expand, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getDelegate(call.execute()); + } + + /** + * The operation to get a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (vmName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String expand = null; + Call call = service.get(resourceGroupName, vmName, this.client.getSubscriptionId(), expand, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The operation to get a virtual machine. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancersOperations.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancersOperations.java index 79020cef10f8..1512e9f9bcfd 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancersOperations.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancersOperations.java @@ -72,6 +72,28 @@ public interface LoadBalancersOperations { */ ServiceCall beginDeleteAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The Get ntework interface operation retreives information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the loadBalancer. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the LoadBalancer object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse get(String resourceGroupName, String loadBalancerName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The Get ntework interface operation retreives information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the loadBalancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The Get ntework interface operation retreives information about the specified network interface. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancersOperationsImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancersOperationsImpl.java index 019bc463d14d..23fc40402132 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancersOperationsImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancersOperationsImpl.java @@ -249,6 +249,79 @@ private ServiceResponse beginDeleteDelegate(Response respons .build(response); } + /** + * The Get ntework interface operation retreives information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the loadBalancer. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the LoadBalancer object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse get(String resourceGroupName, String loadBalancerName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String expand = null; + Call call = service.get(resourceGroupName, loadBalancerName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + return getDelegate(call.execute()); + } + + /** + * The Get ntework interface operation retreives information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the loadBalancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (loadBalancerName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String expand = null; + Call call = service.get(resourceGroupName, loadBalancerName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The Get ntework interface operation retreives information about the specified network interface. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkInterfacesOperations.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkInterfacesOperations.java index 9abe8ce4882f..303ceb01218b 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkInterfacesOperations.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkInterfacesOperations.java @@ -72,6 +72,28 @@ public interface NetworkInterfacesOperations { */ ServiceCall beginDeleteAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The Get ntework interface operation retreives information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the NetworkInterface object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse get(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The Get ntework interface operation retreives information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The Get ntework interface operation retreives information about the specified network interface. * @@ -196,6 +218,32 @@ public interface NetworkInterfacesOperations { */ ServiceCall listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * The Get ntework interface operation retreives information about the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the NetworkInterface object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getVirtualMachineScaleSetNetworkInterface(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The Get ntework interface operation retreives information about the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The Get ntework interface operation retreives information about the specified network interface in a virtual machine scale set. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkInterfacesOperationsImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkInterfacesOperationsImpl.java index 522992e29eee..056ea51620b6 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkInterfacesOperationsImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkInterfacesOperationsImpl.java @@ -269,6 +269,79 @@ private ServiceResponse beginDeleteDelegate(Response respons .build(response); } + /** + * The Get ntework interface operation retreives information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the NetworkInterface object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse get(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String expand = null; + Call call = service.get(resourceGroupName, networkInterfaceName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + return getDelegate(call.execute()); + } + + /** + * The Get ntework interface operation retreives information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (networkInterfaceName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String expand = null; + Call call = service.get(resourceGroupName, networkInterfaceName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The Get ntework interface operation retreives information about the specified network interface. * @@ -708,6 +781,97 @@ private ServiceResponse> listVirtualMachineScaleSetNe .build(response); } + /** + * The Get ntework interface operation retreives information about the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the NetworkInterface object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getVirtualMachineScaleSetNetworkInterface(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String expand = null; + Call call = service.getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + return getVirtualMachineScaleSetNetworkInterfaceDelegate(call.execute()); + } + + /** + * The Get ntework interface operation retreives information about the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (virtualMachineScaleSetName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null.")); + return null; + } + if (virtualmachineIndex == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); + return null; + } + if (networkInterfaceName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String expand = null; + Call call = service.getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getVirtualMachineScaleSetNetworkInterfaceDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The Get ntework interface operation retreives information about the specified network interface in a virtual machine scale set. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkManagementClient.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkManagementClient.java index d02e2045e36d..131186566c02 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkManagementClient.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkManagementClient.java @@ -240,6 +240,26 @@ public interface NetworkManagementClient { */ VirtualNetworksOperations getVirtualNetworksOperations(); + /** + * Checks whether a domain name in the cloudapp.net zone is available for use. + * + * @param location The location of the domain name + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DnsNameAvailabilityResult object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse checkDnsNameAvailability(String location) throws CloudException, IOException, IllegalArgumentException; + + /** + * Checks whether a domain name in the cloudapp.net zone is available for use. + * + * @param location The location of the domain name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall checkDnsNameAvailabilityAsync(String location, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Checks whether a domain name in the cloudapp.net zone is available for use. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkManagementClientImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkManagementClientImpl.java index 668ec6af21a6..a4aefe76b825 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkManagementClientImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkManagementClientImpl.java @@ -399,6 +399,70 @@ interface NetworkManagementClientService { } + /** + * Checks whether a domain name in the cloudapp.net zone is available for use. + * + * @param location The location of the domain name + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DnsNameAvailabilityResult object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse checkDnsNameAvailability(String location) throws CloudException, IOException, IllegalArgumentException { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.getSubscriptionId() is required and cannot be null."); + } + if (this.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.getApiVersion() is required and cannot be null."); + } + String domainNameLabel = null; + Call call = service.checkDnsNameAvailability(location, this.getSubscriptionId(), domainNameLabel, this.getApiVersion(), this.getAcceptLanguage()); + return checkDnsNameAvailabilityDelegate(call.execute()); + } + + /** + * Checks whether a domain name in the cloudapp.net zone is available for use. + * + * @param location The location of the domain name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall checkDnsNameAvailabilityAsync(String location, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (location == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter location is required and cannot be null.")); + return null; + } + if (this.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.getApiVersion() is required and cannot be null.")); + return null; + } + final String domainNameLabel = null; + Call call = service.checkDnsNameAvailability(location, this.getSubscriptionId(), domainNameLabel, this.getApiVersion(), this.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(checkDnsNameAvailabilityDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Checks whether a domain name in the cloudapp.net zone is available for use. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkSecurityGroupsOperations.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkSecurityGroupsOperations.java index 6103d39de10b..ad17a1572f18 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkSecurityGroupsOperations.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkSecurityGroupsOperations.java @@ -72,6 +72,28 @@ public interface NetworkSecurityGroupsOperations { */ ServiceCall beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The Get NetworkSecurityGroups operation retrieves information about the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the NetworkSecurityGroup object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse get(String resourceGroupName, String networkSecurityGroupName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The Get NetworkSecurityGroups operation retrieves information about the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The Get NetworkSecurityGroups operation retrieves information about the specified network security group. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkSecurityGroupsOperationsImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkSecurityGroupsOperationsImpl.java index 99b690ff4a98..4cda64d7eeb1 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkSecurityGroupsOperationsImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkSecurityGroupsOperationsImpl.java @@ -249,6 +249,79 @@ private ServiceResponse beginDeleteDelegate(Response respons .build(response); } + /** + * The Get NetworkSecurityGroups operation retrieves information about the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the NetworkSecurityGroup object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse get(String resourceGroupName, String networkSecurityGroupName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String expand = null; + Call call = service.get(resourceGroupName, networkSecurityGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + return getDelegate(call.execute()); + } + + /** + * The Get NetworkSecurityGroups operation retrieves information about the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (networkSecurityGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String expand = null; + Call call = service.get(resourceGroupName, networkSecurityGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The Get NetworkSecurityGroups operation retrieves information about the specified network security group. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicIPAddressesOperations.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicIPAddressesOperations.java index b017e3ffc191..19fe0f4e621f 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicIPAddressesOperations.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicIPAddressesOperations.java @@ -72,6 +72,28 @@ public interface PublicIPAddressesOperations { */ ServiceCall beginDeleteAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The Get publicIpAddress operation retreives information about the specified pubicIpAddress. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the PublicIPAddress object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse get(String resourceGroupName, String publicIpAddressName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The Get publicIpAddress operation retreives information about the specified pubicIpAddress. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The Get publicIpAddress operation retreives information about the specified pubicIpAddress. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicIPAddressesOperationsImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicIPAddressesOperationsImpl.java index 4e551e1d9a8f..9ae3d9be1370 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicIPAddressesOperationsImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicIPAddressesOperationsImpl.java @@ -249,6 +249,79 @@ private ServiceResponse beginDeleteDelegate(Response respons .build(response); } + /** + * The Get publicIpAddress operation retreives information about the specified pubicIpAddress. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the PublicIPAddress object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse get(String resourceGroupName, String publicIpAddressName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String expand = null; + Call call = service.get(resourceGroupName, publicIpAddressName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + return getDelegate(call.execute()); + } + + /** + * The Get publicIpAddress operation retreives information about the specified pubicIpAddress. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (publicIpAddressName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String expand = null; + Call call = service.get(resourceGroupName, publicIpAddressName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The Get publicIpAddress operation retreives information about the specified pubicIpAddress. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/RouteTablesOperations.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/RouteTablesOperations.java index 3e3125e4d66c..dc3bc004620b 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/RouteTablesOperations.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/RouteTablesOperations.java @@ -72,6 +72,28 @@ public interface RouteTablesOperations { */ ServiceCall beginDeleteAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The Get RouteTables operation retrieves information about the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the RouteTable object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse get(String resourceGroupName, String routeTableName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The Get RouteTables operation retrieves information about the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The Get RouteTables operation retrieves information about the specified route table. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/RouteTablesOperationsImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/RouteTablesOperationsImpl.java index c306a8c1a40e..3c4351324fe4 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/RouteTablesOperationsImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/RouteTablesOperationsImpl.java @@ -249,6 +249,79 @@ private ServiceResponse beginDeleteDelegate(Response respons .build(response); } + /** + * The Get RouteTables operation retrieves information about the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the RouteTable object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse get(String resourceGroupName, String routeTableName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String expand = null; + Call call = service.get(resourceGroupName, routeTableName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + return getDelegate(call.execute()); + } + + /** + * The Get RouteTables operation retrieves information about the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (routeTableName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String expand = null; + Call call = service.get(resourceGroupName, routeTableName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The Get RouteTables operation retrieves information about the specified route table. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/SubnetsOperations.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/SubnetsOperations.java index e512abf8b971..2d758ece3f3f 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/SubnetsOperations.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/SubnetsOperations.java @@ -76,6 +76,30 @@ public interface SubnetsOperations { */ ServiceCall beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The Get subnet operation retreives information about the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Subnet object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse get(String resourceGroupName, String virtualNetworkName, String subnetName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The Get subnet operation retreives information about the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The Get subnet operation retreives information about the specified subnet. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/SubnetsOperationsImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/SubnetsOperationsImpl.java index 611a4d2dad68..0fbb54bb9b77 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/SubnetsOperationsImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/SubnetsOperationsImpl.java @@ -258,6 +258,88 @@ private ServiceResponse beginDeleteDelegate(Response respons .build(response); } + /** + * The Get subnet operation retreives information about the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Subnet object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse get(String resourceGroupName, String virtualNetworkName, String subnetName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String expand = null; + Call call = service.get(resourceGroupName, virtualNetworkName, subnetName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + return getDelegate(call.execute()); + } + + /** + * The Get subnet operation retreives information about the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (virtualNetworkName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + return null; + } + if (subnetName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String expand = null; + Call call = service.get(resourceGroupName, virtualNetworkName, subnetName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The Get subnet operation retreives information about the specified subnet. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewayConnectionsOperations.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewayConnectionsOperations.java index e16620fed52b..56925ec10d52 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewayConnectionsOperations.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewayConnectionsOperations.java @@ -193,6 +193,29 @@ public interface VirtualNetworkGatewayConnectionsOperations { */ ServiceCall listAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the ConnectionResetSharedKey object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse resetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. * @@ -219,6 +242,28 @@ public interface VirtualNetworkGatewayConnectionsOperations { */ ServiceCall resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Long keyLength, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ConnectionResetSharedKey object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse beginResetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. * @@ -244,6 +289,29 @@ public interface VirtualNetworkGatewayConnectionsOperations { */ ServiceCall beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Long keyLength, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the ConnectionSharedKey object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse setSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. * @@ -270,6 +338,28 @@ public interface VirtualNetworkGatewayConnectionsOperations { */ ServiceCall setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ConnectionSharedKey object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse beginSetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewayConnectionsOperationsImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewayConnectionsOperationsImpl.java index 7e835c2960bc..4ac5594fcd23 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewayConnectionsOperationsImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewayConnectionsOperationsImpl.java @@ -671,6 +671,79 @@ private ServiceResponse> listDelegate( .build(response); } + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the ConnectionResetSharedKey object wrapped in ServiceResponse if successful. + */ + public ServiceResponse resetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + final Long keyLength = null; + ConnectionResetSharedKey parameters = new ConnectionResetSharedKey(); + parameters.setKeyLength(keyLength); + Response result = service.resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), parameters).execute(); + return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + final Long keyLength = null; + ConnectionResetSharedKey parameters = new ConnectionResetSharedKey(); + parameters.setKeyLength(keyLength); + Call call = service.resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), parameters); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } /** * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. * @@ -745,6 +818,83 @@ public void onResponse(Call call, Response response) return serviceCall; } + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ConnectionResetSharedKey object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse beginResetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Long keyLength = null; + ConnectionResetSharedKey parameters = new ConnectionResetSharedKey(); + parameters.setKeyLength(keyLength); + Call call = service.beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), parameters); + return beginResetSharedKeyDelegate(call.execute()); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (virtualNetworkGatewayConnectionName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Long keyLength = null; + ConnectionResetSharedKey parameters = new ConnectionResetSharedKey(); + parameters.setKeyLength(keyLength); + Call call = service.beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), parameters); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginResetSharedKeyDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. * @@ -830,6 +980,79 @@ private ServiceResponse beginResetSharedKeyDelegate(Re .build(response); } + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the ConnectionSharedKey object wrapped in ServiceResponse if successful. + */ + public ServiceResponse setSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + final String value = null; + ConnectionSharedKey parameters = new ConnectionSharedKey(); + parameters.setValue(value); + Response result = service.setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), parameters).execute(); + return client.getAzureClient().getPutOrPatchResult(result, new TypeToken() { }.getType()); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + final String value = null; + ConnectionSharedKey parameters = new ConnectionSharedKey(); + parameters.setValue(value); + Call call = service.setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), parameters); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPutOrPatchResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } /** * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. * @@ -904,6 +1127,83 @@ public void onResponse(Call call, Response response) return serviceCall; } + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ConnectionSharedKey object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse beginSetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String value = null; + ConnectionSharedKey parameters = new ConnectionSharedKey(); + parameters.setValue(value); + Call call = service.beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), parameters); + return beginSetSharedKeyDelegate(call.execute()); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (virtualNetworkGatewayConnectionName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String value = null; + ConnectionSharedKey parameters = new ConnectionSharedKey(); + parameters.setValue(value); + Call call = service.beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), parameters); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginSetSharedKeyDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaysOperations.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaysOperations.java index 55434d3f4611..2673b0c51915 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaysOperations.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaysOperations.java @@ -218,6 +218,28 @@ public interface VirtualNetworkGatewaysOperations { */ ServiceCall beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGateway parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The Generatevpnclientpackage operation generates Vpn client package for P2S client of the virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the String object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse generatevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The Generatevpnclientpackage operation generates Vpn client package for P2S client of the virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The Generatevpnclientpackage operation generates Vpn client package for P2S client of the virtual network gateway in the specified resource group through Network resource provider. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaysOperationsImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaysOperationsImpl.java index 07d62a2f898e..61bcc7b38d89 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaysOperationsImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaysOperationsImpl.java @@ -751,6 +751,83 @@ private ServiceResponse beginResetDelegate(Response generatevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String processorArchitecture = null; + VpnClientParameters parameters = new VpnClientParameters(); + parameters.setProcessorArchitecture(processorArchitecture); + Call call = service.generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), parameters); + return generatevpnclientpackageDelegate(call.execute()); + } + + /** + * The Generatevpnclientpackage operation generates Vpn client package for P2S client of the virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (virtualNetworkGatewayName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String processorArchitecture = null; + VpnClientParameters parameters = new VpnClientParameters(); + parameters.setProcessorArchitecture(processorArchitecture); + Call call = service.generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), parameters); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(generatevpnclientpackageDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The Generatevpnclientpackage operation generates Vpn client package for P2S client of the virtual network gateway in the specified resource group through Network resource provider. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworksOperations.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworksOperations.java index df87f64c43e5..9becddde3758 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworksOperations.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworksOperations.java @@ -72,6 +72,28 @@ public interface VirtualNetworksOperations { */ ServiceCall beginDeleteAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * The Get VirtualNetwork operation retrieves information about the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the VirtualNetwork object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse get(String resourceGroupName, String virtualNetworkName) throws CloudException, IOException, IllegalArgumentException; + + /** + * The Get VirtualNetwork operation retrieves information about the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * The Get VirtualNetwork operation retrieves information about the specified virtual network. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworksOperationsImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworksOperationsImpl.java index f6b5fcfbb7d1..218df96b05ae 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworksOperationsImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworksOperationsImpl.java @@ -249,6 +249,79 @@ private ServiceResponse beginDeleteDelegate(Response respons .build(response); } + /** + * The Get VirtualNetwork operation retrieves information about the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the VirtualNetwork object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse get(String resourceGroupName, String virtualNetworkName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String expand = null; + Call call = service.get(resourceGroupName, virtualNetworkName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + return getDelegate(call.execute()); + } + + /** + * The Get VirtualNetwork operation retrieves information about the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (virtualNetworkName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String expand = null; + Call call = service.get(resourceGroupName, virtualNetworkName, this.client.getSubscriptionId(), this.client.getApiVersion(), expand, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * The Get VirtualNetwork operation retrieves information about the specified virtual network. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentOperationsOperations.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentOperationsOperations.java index 2394e8f48c28..55ee1c935632 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentOperationsOperations.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentOperationsOperations.java @@ -50,6 +50,28 @@ public interface DeploymentOperationsOperations { */ ServiceCall getAsync(String resourceGroupName, String deploymentName, String operationId, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets a list of deployments operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DeploymentOperation> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list(final String resourceGroupName, final String deploymentName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets a list of deployments operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final String resourceGroupName, final String deploymentName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Gets a list of deployments operations. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentOperationsOperationsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentOperationsOperationsImpl.java index 759070b2d2ae..534fcb125188 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentOperationsOperationsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentOperationsOperationsImpl.java @@ -160,6 +160,92 @@ private ServiceResponse getDelegate(Response .build(response); } + /** + * Gets a list of deployments operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DeploymentOperation> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list(final String resourceGroupName, final String deploymentName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Integer top = null; + Call call = service.list(resourceGroupName, deploymentName, this.client.getSubscriptionId(), top, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets a list of deployments operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final String resourceGroupName, final String deploymentName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (deploymentName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Integer top = null; + Call call = service.list(resourceGroupName, deploymentName, this.client.getSubscriptionId(), top, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets a list of deployments operations. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentsOperations.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentsOperations.java index 52a128c02d34..de7765e04b76 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentsOperations.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentsOperations.java @@ -220,6 +220,26 @@ public interface DeploymentsOperations { */ ServiceCall validateAsync(String resourceGroupName, String deploymentName, Deployment parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get a list of deployments. + * + * @param resourceGroupName The name of the resource group to filter by. The name is case insensitive. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DeploymentExtended> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get a list of deployments. + * + * @param resourceGroupName The name of the resource group to filter by. The name is case insensitive. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Get a list of deployments. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentsOperationsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentsOperationsImpl.java index 92fc3c62e135..d0f2897fca2a 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentsOperationsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/DeploymentsOperationsImpl.java @@ -750,6 +750,85 @@ private ServiceResponse validateDelegate(Response> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + DeploymentExtendedFilter filter = null; + Integer top = null; + Call call = service.list(resourceGroupName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Get a list of deployments. + * + * @param resourceGroupName The name of the resource group to filter by. The name is case insensitive. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final DeploymentExtendedFilter filter = null; + final Integer top = null; + Call call = service.list(resourceGroupName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Get a list of deployments. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyAssignmentsOperations.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyAssignmentsOperations.java index 3bbf2165ee93..a40dd69c7722 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyAssignmentsOperations.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyAssignmentsOperations.java @@ -25,6 +25,34 @@ * in PolicyAssignmentsOperations. */ public interface PolicyAssignmentsOperations { + /** + * Gets policy assignments of the resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The name of the resource provider. + * @param parentResourcePath The parent resource path. + * @param resourceType The resource type. + * @param resourceName The resource name. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<PolicyAssignment> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listForResource(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets policy assignments of the resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The name of the resource provider. + * @param parentResourcePath The parent resource path. + * @param resourceType The resource type. + * @param resourceName The resource name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Gets policy assignments of the resource. * @@ -56,6 +84,26 @@ public interface PolicyAssignmentsOperations { */ ServiceCall listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets policy assignments of the resource group. + * + * @param resourceGroupName Resource group name. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<PolicyAssignment> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listForResourceGroup(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets policy assignments of the resource group. + * + * @param resourceGroupName Resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listForResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Gets policy assignments of the resource group. * @@ -215,6 +263,24 @@ public interface PolicyAssignmentsOperations { */ ServiceCall getByIdAsync(String policyAssignmentId, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets policy assignments of the subscription. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<PolicyAssignment> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets policy assignments of the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Gets policy assignments of the subscription. * @@ -236,6 +302,26 @@ public interface PolicyAssignmentsOperations { */ ServiceCall listAsync(final String filter, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets policy assignments of the scope. + * + * @param scope Scope. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<PolicyAssignment> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listForScope(final String scope) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets policy assignments of the scope. + * + * @param scope Scope. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listForScopeAsync(final String scope, final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Gets policy assignments of the scope. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyAssignmentsOperationsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyAssignmentsOperationsImpl.java index dfe2ef9acef0..ce6e04ed4abf 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyAssignmentsOperationsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyAssignmentsOperationsImpl.java @@ -121,6 +121,119 @@ interface PolicyAssignmentsService { } + /** + * Gets policy assignments of the resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The name of the resource provider. + * @param parentResourcePath The parent resource path. + * @param resourceType The resource type. + * @param resourceName The resource name. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<PolicyAssignment> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listForResource(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceProviderNamespace == null) { + throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); + } + if (parentResourcePath == null) { + throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null."); + } + if (resourceType == null) { + throw new IllegalArgumentException("Parameter resourceType is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String filter = null; + Call call = service.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listForResourceDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listForResourceNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets policy assignments of the resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The name of the resource provider. + * @param parentResourcePath The parent resource path. + * @param resourceType The resource type. + * @param resourceName The resource name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (resourceProviderNamespace == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + return null; + } + if (parentResourcePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + return null; + } + if (resourceType == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + return null; + } + if (resourceName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String filter = null; + Call call = service.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listForResourceDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listForResourceNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets policy assignments of the resource. * @@ -241,6 +354,83 @@ private ServiceResponse> listForResourceDelegate(Resp .build(response); } + /** + * Gets policy assignments of the resource group. + * + * @param resourceGroupName Resource group name. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<PolicyAssignment> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listForResourceGroup(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String filter = null; + Call call = service.listForResourceGroup(resourceGroupName, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listForResourceGroupDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listForResourceGroupNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets policy assignments of the resource group. + * + * @param resourceGroupName Resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listForResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String filter = null; + Call call = service.listForResourceGroup(resourceGroupName, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listForResourceGroupDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listForResourceGroupNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets policy assignments of the resource group. * @@ -788,6 +978,74 @@ private ServiceResponse getByIdDelegate(Response .build(response); } + /** + * Gets policy assignments of the subscription. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<PolicyAssignment> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String filter = null; + Call call = service.list(this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets policy assignments of the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String filter = null; + Call call = service.list(this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets policy assignments of the subscription. * @@ -863,6 +1121,83 @@ private ServiceResponse> listDelegate(Response> listForScope(final String scope) throws CloudException, IOException, IllegalArgumentException { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String filter = null; + Call call = service.listForScope(scope, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listForScopeDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listForScopeNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets policy assignments of the scope. + * + * @param scope Scope. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listForScopeAsync(final String scope, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (scope == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String filter = null; + Call call = service.listForScope(scope, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listForScopeDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listForScopeNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets policy assignments of the scope. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProviderOperationsMetadataOperations.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProviderOperationsMetadataOperations.java index ed56a3f3b5f4..ebed7f69acde 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProviderOperationsMetadataOperations.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProviderOperationsMetadataOperations.java @@ -25,6 +25,28 @@ * in ProviderOperationsMetadataOperations. */ public interface ProviderOperationsMetadataOperations { + /** + * Gets provider operations metadata. + * + * @param resourceProviderNamespace Namespace of the resource provider. + * @param apiVersion the String value + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ProviderOperationsMetadata object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse get(String resourceProviderNamespace, String apiVersion) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets provider operations metadata. + * + * @param resourceProviderNamespace Namespace of the resource provider. + * @param apiVersion the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAsync(String resourceProviderNamespace, String apiVersion, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Gets provider operations metadata. * @@ -50,6 +72,26 @@ public interface ProviderOperationsMetadataOperations { */ ServiceCall getAsync(String resourceProviderNamespace, String apiVersion, String expand, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets provider operations metadata list. + * + * @param apiVersion the String value + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<ProviderOperationsMetadata> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list(final String apiVersion) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets provider operations metadata list. + * + * @param apiVersion the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final String apiVersion, final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Gets provider operations metadata list. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProviderOperationsMetadataOperationsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProviderOperationsMetadataOperationsImpl.java index d06e7facfd48..6a7f5448ea39 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProviderOperationsMetadataOperationsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProviderOperationsMetadataOperationsImpl.java @@ -73,6 +73,65 @@ interface ProviderOperationsMetadataService { } + /** + * Gets provider operations metadata. + * + * @param resourceProviderNamespace Namespace of the resource provider. + * @param apiVersion the String value + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ProviderOperationsMetadata object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse get(String resourceProviderNamespace, String apiVersion) throws CloudException, IOException, IllegalArgumentException { + if (resourceProviderNamespace == null) { + throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + String expand = null; + Call call = service.get(resourceProviderNamespace, apiVersion, expand, this.client.getAcceptLanguage()); + return getDelegate(call.execute()); + } + + /** + * Gets provider operations metadata. + * + * @param resourceProviderNamespace Namespace of the resource provider. + * @param apiVersion the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAsync(String resourceProviderNamespace, String apiVersion, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceProviderNamespace == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + return null; + } + if (apiVersion == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + return null; + } + final String expand = null; + Call call = service.get(resourceProviderNamespace, apiVersion, expand, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets provider operations metadata. * @@ -139,6 +198,69 @@ private ServiceResponse getDelegate(Response> list(final String apiVersion) throws CloudException, IOException, IllegalArgumentException { + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + String expand = null; + Call call = service.list(apiVersion, expand, this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets provider operations metadata list. + * + * @param apiVersion the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final String apiVersion, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (apiVersion == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + return null; + } + final String expand = null; + Call call = service.list(apiVersion, expand, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets provider operations metadata list. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProvidersOperations.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProvidersOperations.java index c5507c13f58e..6b784b333af6 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProvidersOperations.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProvidersOperations.java @@ -67,6 +67,24 @@ public interface ProvidersOperations { */ ServiceCall registerAsync(String resourceProviderNamespace, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets a list of resource providers. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<Provider> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets a list of resource providers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Gets a list of resource providers. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProvidersOperationsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProvidersOperationsImpl.java index 1ea8d472e366..7d6d71651c09 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProvidersOperationsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ProvidersOperationsImpl.java @@ -220,6 +220,74 @@ private ServiceResponse registerDelegate(Response respon .build(response); } + /** + * Gets a list of resource providers. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<Provider> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Integer top = null; + Call call = service.list(this.client.getSubscriptionId(), top, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets a list of resource providers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Integer top = null; + Call call = service.list(this.client.getSubscriptionId(), top, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets a list of resource providers. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroupsOperations.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroupsOperations.java index fe316f885dbe..f90d1e223d19 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroupsOperations.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroupsOperations.java @@ -28,6 +28,26 @@ * in ResourceGroupsOperations. */ public interface ResourceGroupsOperations { + /** + * Get all of the resources under a subscription. + * + * @param resourceGroupName Query parameters. If null is passed returns all resource groups. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<GenericResource> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listResources(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get all of the resources under a subscription. + * + * @param resourceGroupName Query parameters. If null is passed returns all resource groups. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listResourcesAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Get all of the resources under a subscription. * @@ -184,6 +204,24 @@ public interface ResourceGroupsOperations { */ ServiceCall patchAsync(String resourceGroupName, ResourceGroup parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets a collection of resource groups. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<ResourceGroup> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets a collection of resource groups. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Gets a collection of resource groups. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroupsOperationsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroupsOperationsImpl.java index 19c8c3e76ac2..b37cc23e89e8 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroupsOperationsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroupsOperationsImpl.java @@ -112,6 +112,85 @@ interface ResourceGroupsService { } + /** + * Get all of the resources under a subscription. + * + * @param resourceGroupName Query parameters. If null is passed returns all resource groups. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<GenericResource> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listResources(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + GenericResourceFilter filter = null; + Integer top = null; + Call call = service.listResources(resourceGroupName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listResourcesDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listResourcesNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Get all of the resources under a subscription. + * + * @param resourceGroupName Query parameters. If null is passed returns all resource groups. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listResourcesAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final GenericResourceFilter filter = null; + final Integer top = null; + Call call = service.listResources(resourceGroupName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listResourcesDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listResourcesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Get all of the resources under a subscription. * @@ -629,6 +708,76 @@ private ServiceResponse patchDelegate(Response resp .build(response); } + /** + * Gets a collection of resource groups. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<ResourceGroup> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + ResourceGroupFilter filter = null; + Integer top = null; + Call call = service.list(this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets a collection of resource groups. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final ResourceGroupFilter filter = null; + final Integer top = null; + Call call = service.list(this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets a collection of resource groups. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourcesOperations.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourcesOperations.java index c7ab8bd1f5c3..7583c6ec7860 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourcesOperations.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourcesOperations.java @@ -74,6 +74,24 @@ public interface ResourcesOperations { */ ServiceCall beginMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get all of the resources under a subscription. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<GenericResource> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException; + + /** + * Get all of the resources under a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Get all of the resources under a subscription. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourcesOperationsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourcesOperationsImpl.java index b00d5cb1ef49..250d968c524a 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourcesOperationsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourcesOperationsImpl.java @@ -253,6 +253,76 @@ private ServiceResponse beginMoveResourcesDelegate(Response .build(response); } + /** + * Get all of the resources under a subscription. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<GenericResource> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + GenericResourceFilter filter = null; + Integer top = null; + Call call = service.list(this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Get all of the resources under a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final GenericResourceFilter filter = null; + final Integer top = null; + Call call = service.list(this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Get all of the resources under a subscription. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleAssignmentsOperations.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleAssignmentsOperations.java index 0cc5e1c31038..d6b60707aef1 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleAssignmentsOperations.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleAssignmentsOperations.java @@ -27,6 +27,34 @@ * in RoleAssignmentsOperations. */ public interface RoleAssignmentsOperations { + /** + * Gets role assignments of the resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace Resource identity. + * @param parentResourcePath Resource identity. + * @param resourceType Resource identity. + * @param resourceName Resource identity. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<RoleAssignment> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listForResource(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets role assignments of the resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace Resource identity. + * @param parentResourcePath Resource identity. + * @param resourceType Resource identity. + * @param resourceName Resource identity. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Gets role assignments of the resource. * @@ -58,6 +86,26 @@ public interface RoleAssignmentsOperations { */ ServiceCall listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final RoleAssignmentFilter filter, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets role assignments of the resource group. + * + * @param resourceGroupName Resource group name. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<RoleAssignment> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listForResourceGroup(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets role assignments of the resource group. + * + * @param resourceGroupName Resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listForResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Gets role assignments of the resource group. * @@ -217,6 +265,24 @@ public interface RoleAssignmentsOperations { */ ServiceCall getByIdAsync(String roleAssignmentId, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets role assignments of the subscription. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<RoleAssignment> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets role assignments of the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Gets role assignments of the subscription. * @@ -238,6 +304,26 @@ public interface RoleAssignmentsOperations { */ ServiceCall listAsync(final RoleAssignmentFilter filter, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets role assignments of the scope. + * + * @param scope Scope. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<RoleAssignment> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listForScope(final String scope) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets role assignments of the scope. + * + * @param scope Scope. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listForScopeAsync(final String scope, final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Gets role assignments of the scope. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleAssignmentsOperationsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleAssignmentsOperationsImpl.java index 55b07c9447cb..9190b50f3629 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleAssignmentsOperationsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleAssignmentsOperationsImpl.java @@ -123,6 +123,119 @@ interface RoleAssignmentsService { } + /** + * Gets role assignments of the resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace Resource identity. + * @param parentResourcePath Resource identity. + * @param resourceType Resource identity. + * @param resourceName Resource identity. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<RoleAssignment> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listForResource(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceProviderNamespace == null) { + throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); + } + if (parentResourcePath == null) { + throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null."); + } + if (resourceType == null) { + throw new IllegalArgumentException("Parameter resourceType is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + RoleAssignmentFilter filter = null; + Call call = service.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listForResourceDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listForResourceNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets role assignments of the resource. + * + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace Resource identity. + * @param parentResourcePath Resource identity. + * @param resourceType Resource identity. + * @param resourceName Resource identity. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (resourceProviderNamespace == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + return null; + } + if (parentResourcePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + return null; + } + if (resourceType == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + return null; + } + if (resourceName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final RoleAssignmentFilter filter = null; + Call call = service.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listForResourceDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listForResourceNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets role assignments of the resource. * @@ -245,6 +358,83 @@ private ServiceResponse> listForResourceDelegate(Respon .build(response); } + /** + * Gets role assignments of the resource group. + * + * @param resourceGroupName Resource group name. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<RoleAssignment> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listForResourceGroup(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + RoleAssignmentFilter filter = null; + Call call = service.listForResourceGroup(resourceGroupName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listForResourceGroupDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listForResourceGroupNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets role assignments of the resource group. + * + * @param resourceGroupName Resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listForResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final RoleAssignmentFilter filter = null; + Call call = service.listForResourceGroup(resourceGroupName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listForResourceGroupDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listForResourceGroupNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets role assignments of the resource group. * @@ -752,6 +942,74 @@ private ServiceResponse getByIdDelegate(Response r .build(response); } + /** + * Gets role assignments of the subscription. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<RoleAssignment> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + RoleAssignmentFilter filter = null; + Call call = service.list(this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets role assignments of the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final RoleAssignmentFilter filter = null; + Call call = service.list(this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets role assignments of the subscription. * @@ -829,6 +1087,76 @@ private ServiceResponse> listDelegate(Response> listForScope(final String scope) throws CloudException, IOException, IllegalArgumentException { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + RoleAssignmentFilter filter = null; + Call call = service.listForScope(scope, this.client.getMapperAdapter().serializeRaw(filter), this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listForScopeDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listForScopeNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets role assignments of the scope. + * + * @param scope Scope. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listForScopeAsync(final String scope, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (scope == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final RoleAssignmentFilter filter = null; + Call call = service.listForScope(scope, this.client.getMapperAdapter().serializeRaw(filter), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listForScopeDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listForScopeNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets role assignments of the scope. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleDefinitionsOperations.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleDefinitionsOperations.java index 918726b00458..13612d8b9625 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleDefinitionsOperations.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleDefinitionsOperations.java @@ -118,6 +118,26 @@ public interface RoleDefinitionsOperations { */ ServiceCall getByIdAsync(String roleDefinitionId, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get all role definitions that are applicable at scope and above. Use atScopeAndBelow filter to search below the given scope as well. + * + * @param scope Scope + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<RoleDefinition> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list(final String scope) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get all role definitions that are applicable at scope and above. Use atScopeAndBelow filter to search below the given scope as well. + * + * @param scope Scope + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final String scope, final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Get all role definitions that are applicable at scope and above. Use atScopeAndBelow filter to search below the given scope as well. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleDefinitionsOperationsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleDefinitionsOperationsImpl.java index b2f3621136e7..e019267c3d1d 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleDefinitionsOperationsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/RoleDefinitionsOperationsImpl.java @@ -376,6 +376,76 @@ private ServiceResponse getByIdDelegate(Response r .build(response); } + /** + * Get all role definitions that are applicable at scope and above. Use atScopeAndBelow filter to search below the given scope as well. + * + * @param scope Scope + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<RoleDefinition> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list(final String scope) throws CloudException, IOException, IllegalArgumentException { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + RoleDefinitionFilter filter = null; + Call call = service.list(scope, this.client.getMapperAdapter().serializeRaw(filter), this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Get all role definitions that are applicable at scope and above. Use atScopeAndBelow filter to search below the given scope as well. + * + * @param scope Scope + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final String scope, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (scope == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final RoleDefinitionFilter filter = null; + Call call = service.list(scope, this.client.getMapperAdapter().serializeRaw(filter), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Get all role definitions that are applicable at scope and above. Use atScopeAndBelow filter to search below the given scope as well. * diff --git a/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/ResourceGroupsOperationsTests.java b/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/ResourceGroupsOperationsTests.java index 6267629654dd..f73b4d3677bb 100644 --- a/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/ResourceGroupsOperationsTests.java +++ b/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/ResourceGroupsOperationsTests.java @@ -21,7 +21,7 @@ public void canCreateResourceGroup() throws Exception { group.getTags().put("tagname", "tagvalue"); resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); // List - List listResult = resourceManagementClient.getResourceGroupsOperations().list(null, null).getBody(); + List listResult = resourceManagementClient.getResourceGroupsOperations().list().getBody(); ResourceGroup groupResult = null; for (ResourceGroup rg : listResult) { if (rg.getName().equals(rgName)) { diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountsOperations.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountsOperations.java index a81c68a3804a..858d1e2c82a5 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountsOperations.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountsOperations.java @@ -27,6 +27,26 @@ * in StorageAccountsOperations. */ public interface StorageAccountsOperations { + /** + * Checks that account name is valid and is not in use. + * + * @param name the String value + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the CheckNameAvailabilityResult object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse checkNameAvailability(String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Checks that account name is valid and is not in use. + * + * @param name the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Checks that account name is valid and is not in use. * diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountsOperationsImpl.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountsOperationsImpl.java index 342923504bcf..ff37429a0807 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountsOperationsImpl.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountsOperationsImpl.java @@ -112,6 +112,76 @@ interface StorageAccountsService { } + /** + * Checks that account name is valid and is not in use. + * + * @param name the String value + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the CheckNameAvailabilityResult object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse checkNameAvailability(String name) throws CloudException, IOException, IllegalArgumentException { + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + String type = null; + StorageAccountCheckNameAvailabilityParameters accountName = new StorageAccountCheckNameAvailabilityParameters(); + accountName.setName(name); + accountName.setType(type); + Call call = service.checkNameAvailability(this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), accountName); + return checkNameAvailabilityDelegate(call.execute()); + } + + /** + * Checks that account name is valid and is not in use. + * + * @param name the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + final String type = null; + StorageAccountCheckNameAvailabilityParameters accountName = new StorageAccountCheckNameAvailabilityParameters(); + accountName.setName(name); + accountName.setType(type); + Call call = service.checkNameAvailability(this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), accountName); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(checkNameAvailabilityDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Checks that account name is valid and is not in use. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/DomainsOperations.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/DomainsOperations.java index 9e5e9e860e62..9efc0c34c1a9 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/DomainsOperations.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/DomainsOperations.java @@ -92,6 +92,28 @@ public interface DomainsOperations { */ ServiceCall createOrUpdateDomainAsync(String resourceGroupName, String domainName, Domain domain, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Deletes a domain. + * + * @param resourceGroupName Name of the resource group + * @param domainName Name of the domain + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse deleteDomain(String resourceGroupName, String domainName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Deletes a domain. + * + * @param resourceGroupName Name of the resource group + * @param domainName Name of the domain + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall deleteDomainAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Deletes a domain. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/DomainsOperationsImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/DomainsOperationsImpl.java index dfe163cda33a..e96fc4bd404e 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/DomainsOperationsImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/DomainsOperationsImpl.java @@ -324,6 +324,79 @@ private ServiceResponse createOrUpdateDomainDelegate(Response deleteDomain(String resourceGroupName, String domainName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Boolean forceHardDeleteDomain = null; + Call call = service.deleteDomain(resourceGroupName, domainName, this.client.getSubscriptionId(), forceHardDeleteDomain, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteDomainDelegate(call.execute()); + } + + /** + * Deletes a domain. + * + * @param resourceGroupName Name of the resource group + * @param domainName Name of the domain + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall deleteDomainAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (domainName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Boolean forceHardDeleteDomain = null; + Call call = service.deleteDomain(resourceGroupName, domainName, this.client.getSubscriptionId(), forceHardDeleteDomain, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(deleteDomainDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Deletes a domain. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalDomainRegistrationOperations.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalDomainRegistrationOperations.java index 8cd8ac8ee373..6142b8c9f856 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalDomainRegistrationOperations.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalDomainRegistrationOperations.java @@ -86,6 +86,24 @@ public interface GlobalDomainRegistrationOperations { */ ServiceCall validateDomainPurchaseInformationAsync(DomainRegistrationInput domainRegistrationInput, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Checks if a domain is available for registration. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DomainAvailablilityCheckResult object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse checkDomainAvailability() throws CloudException, IOException, IllegalArgumentException; + + /** + * Checks if a domain is available for registration. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall checkDomainAvailabilityAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Checks if a domain is available for registration. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalDomainRegistrationOperationsImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalDomainRegistrationOperationsImpl.java index 3a32286f2199..ecede63807f6 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalDomainRegistrationOperationsImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalDomainRegistrationOperationsImpl.java @@ -277,6 +277,65 @@ private ServiceResponse validateDomainPurchaseInformationDelegate(Respon .build(response); } + /** + * Checks if a domain is available for registration. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DomainAvailablilityCheckResult object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse checkDomainAvailability() throws CloudException, IOException, IllegalArgumentException { + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String name = null; + NameIdentifier identifier = new NameIdentifier(); + identifier.setName(name); + Call call = service.checkDomainAvailability(this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), identifier); + return checkDomainAvailabilityDelegate(call.execute()); + } + + /** + * Checks if a domain is available for registration. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall checkDomainAvailabilityAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String name = null; + NameIdentifier identifier = new NameIdentifier(); + identifier.setName(name); + Call call = service.checkDomainAvailability(this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), identifier); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(checkDomainAvailabilityDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Checks if a domain is available for registration. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalOperations.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalOperations.java index 4017c3ceff2d..4e3357c66823 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalOperations.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalOperations.java @@ -109,6 +109,24 @@ public interface GlobalOperations { */ ServiceCall getAllCertificatesAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets all App Service Plans for a subcription. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ServerFarmCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getAllServerFarms() throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets all App Service Plans for a subcription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAllServerFarmsAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Gets all App Service Plans for a subcription. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalOperationsImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalOperationsImpl.java index f18660188658..1324791fbe8d 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalOperationsImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/GlobalOperationsImpl.java @@ -373,6 +373,61 @@ private ServiceResponse getAllCertificatesDelegate(Respon .build(response); } + /** + * Gets all App Service Plans for a subcription. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ServerFarmCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getAllServerFarms() throws CloudException, IOException, IllegalArgumentException { + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Boolean detailed = null; + Call call = service.getAllServerFarms(this.client.getSubscriptionId(), detailed, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getAllServerFarmsDelegate(call.execute()); + } + + /** + * Gets all App Service Plans for a subcription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAllServerFarmsAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Boolean detailed = null; + Call call = service.getAllServerFarms(this.client.getSubscriptionId(), detailed, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getAllServerFarmsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets all App Service Plans for a subcription. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/HostingEnvironmentsOperations.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/HostingEnvironmentsOperations.java index 0a5b4e7cd10f..41fa9bdab3ac 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/HostingEnvironmentsOperations.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/HostingEnvironmentsOperations.java @@ -111,6 +111,29 @@ public interface HostingEnvironmentsOperations { */ ServiceCall beginCreateOrUpdateHostingEnvironmentAsync(String resourceGroupName, String name, HostingEnvironment hostingEnvironmentEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Delete a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse deleteHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * Delete a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall deleteHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Delete a hostingEnvironment (App Service Environment). * @@ -137,6 +160,28 @@ public interface HostingEnvironmentsOperations { */ ServiceCall deleteHostingEnvironmentAsync(String resourceGroupName, String name, Boolean forceDelete, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Delete a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse beginDeleteHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Delete a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginDeleteHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Delete a hostingEnvironment (App Service Environment). * @@ -348,6 +393,28 @@ public interface HostingEnvironmentsOperations { */ ServiceCall getHostingEnvironmentOperationAsync(String resourceGroupName, String name, String operationId, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get global metrics of hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getHostingEnvironmentMetrics(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get global metrics of hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getHostingEnvironmentMetricsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Get global metrics of hostingEnvironment (App Service Environment). * @@ -398,6 +465,28 @@ public interface HostingEnvironmentsOperations { */ ServiceCall getHostingEnvironmentMetricDefinitionsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get global usages of hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the CsmUsageQuotaCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getHostingEnvironmentUsages(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get global usages of hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getHostingEnvironmentUsagesAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Get global usages of hostingEnvironment (App Service Environment). * @@ -423,6 +512,28 @@ public interface HostingEnvironmentsOperations { */ ServiceCall getHostingEnvironmentUsagesAsync(String resourceGroupName, String name, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get metrics for a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getHostingEnvironmentMultiRoleMetrics(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get metrics for a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getHostingEnvironmentMultiRoleMetricsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Get metrics for a multiRole pool of a hostingEnvironment (App Service Environment). * @@ -456,6 +567,30 @@ public interface HostingEnvironmentsOperations { */ ServiceCall getHostingEnvironmentMultiRoleMetricsAsync(String resourceGroupName, String name, String startTime, String endTime, String timeGrain, Boolean details, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get metrics for a worker pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getHostingEnvironmentWebWorkerMetrics(String resourceGroupName, String name, String workerPoolName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get metrics for a worker pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getHostingEnvironmentWebWorkerMetricsAsync(String resourceGroupName, String name, String workerPoolName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Get metrics for a worker pool of a hostingEnvironment (App Service Environment). * @@ -581,6 +716,28 @@ public interface HostingEnvironmentsOperations { */ ServiceCall getHostingEnvironmentWebWorkerUsagesAsync(String resourceGroupName, String name, String workerPoolName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get all sites on the hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the SiteCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getHostingEnvironmentSites(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get all sites on the hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getHostingEnvironmentSitesAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Get all sites on the hostingEnvironment (App Service Environment). * @@ -900,6 +1057,32 @@ public interface HostingEnvironmentsOperations { */ ServiceCall getWorkerPoolSkusAsync(String resourceGroupName, String name, String workerPoolName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get metrics for a specific instance of a worker pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @param instance Name of instance in the worker pool + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getWorkerPoolInstanceMetrics(String resourceGroupName, String name, String workerPoolName, String instance) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get metrics for a specific instance of a worker pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @param instance Name of instance in the worker pool + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getWorkerPoolInstanceMetricsAsync(String resourceGroupName, String name, String workerPoolName, String instance, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Get metrics for a specific instance of a worker pool of a hostingEnvironment (App Service Environment). * @@ -958,6 +1141,30 @@ public interface HostingEnvironmentsOperations { */ ServiceCall getWorkerPoolInstanceMetricDefinitionsAsync(String resourceGroupName, String name, String workerPoolName, String instance, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get metrics for a specific instance of a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param instance Name of instance in the multiRole pool + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getMultiRolePoolInstanceMetrics(String resourceGroupName, String name, String instance) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get metrics for a specific instance of a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param instance Name of instance in the multiRole pool + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getMultiRolePoolInstanceMetricsAsync(String resourceGroupName, String name, String instance, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Get metrics for a specific instance of a multiRole pool of a hostingEnvironment (App Service Environment). * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/HostingEnvironmentsOperationsImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/HostingEnvironmentsOperationsImpl.java index a05f78f21ea0..5fc9c23af1ac 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/HostingEnvironmentsOperationsImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/HostingEnvironmentsOperationsImpl.java @@ -499,6 +499,75 @@ private ServiceResponse beginCreateOrUpdateHostingEnvironmen .build(response); } + /** + * Delete a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the Object object wrapped in ServiceResponse if successful. + */ + public ServiceResponse deleteHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + final Boolean forceDelete = null; + Response result = service.deleteHostingEnvironment(resourceGroupName, name, this.client.getSubscriptionId(), forceDelete, this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); + } + + /** + * Delete a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall deleteHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + final Boolean forceDelete = null; + Call call = service.deleteHostingEnvironment(resourceGroupName, name, this.client.getSubscriptionId(), forceDelete, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } /** * Delete a hostingEnvironment (App Service Environment). * @@ -569,6 +638,79 @@ public void onResponse(Call call, Response response) return serviceCall; } + /** + * Delete a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse beginDeleteHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Boolean forceDelete = null; + Call call = service.beginDeleteHostingEnvironment(resourceGroupName, name, this.client.getSubscriptionId(), forceDelete, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginDeleteHostingEnvironmentDelegate(call.execute()); + } + + /** + * Delete a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginDeleteHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Boolean forceDelete = null; + Call call = service.beginDeleteHostingEnvironment(resourceGroupName, name, this.client.getSubscriptionId(), forceDelete, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginDeleteHostingEnvironmentDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Delete a hostingEnvironment (App Service Environment). * @@ -1292,6 +1434,81 @@ private ServiceResponse getHostingEnvironmentOperationDelegate(Response< .build(response); } + /** + * Get global metrics of hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getHostingEnvironmentMetrics(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Boolean details = null; + String filter = null; + Call call = service.getHostingEnvironmentMetrics(resourceGroupName, name, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getHostingEnvironmentMetricsDelegate(call.execute()); + } + + /** + * Get global metrics of hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getHostingEnvironmentMetricsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Boolean details = null; + final String filter = null; + Call call = service.getHostingEnvironmentMetrics(resourceGroupName, name, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getHostingEnvironmentMetricsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Get global metrics of hostingEnvironment (App Service Environment). * @@ -1452,6 +1669,79 @@ private ServiceResponse getHostingEnvironmentMetricDefinitions .build(response); } + /** + * Get global usages of hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the CsmUsageQuotaCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getHostingEnvironmentUsages(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String filter = null; + Call call = service.getHostingEnvironmentUsages(resourceGroupName, name, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getHostingEnvironmentUsagesDelegate(call.execute()); + } + + /** + * Get global usages of hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getHostingEnvironmentUsagesAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String filter = null; + Call call = service.getHostingEnvironmentUsages(resourceGroupName, name, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getHostingEnvironmentUsagesDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Get global usages of hostingEnvironment (App Service Environment). * @@ -1532,6 +1822,87 @@ private ServiceResponse getHostingEnvironmentUsagesDele .build(response); } + /** + * Get metrics for a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getHostingEnvironmentMultiRoleMetrics(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String startTime = null; + String endTime = null; + String timeGrain = null; + Boolean details = null; + String filter = null; + Call call = service.getHostingEnvironmentMultiRoleMetrics(resourceGroupName, name, this.client.getSubscriptionId(), startTime, endTime, timeGrain, details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getHostingEnvironmentMultiRoleMetricsDelegate(call.execute()); + } + + /** + * Get metrics for a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getHostingEnvironmentMultiRoleMetricsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String startTime = null; + final String endTime = null; + final String timeGrain = null; + final Boolean details = null; + final String filter = null; + Call call = service.getHostingEnvironmentMultiRoleMetrics(resourceGroupName, name, this.client.getSubscriptionId(), startTime, endTime, timeGrain, details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getHostingEnvironmentMultiRoleMetricsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Get metrics for a multiRole pool of a hostingEnvironment (App Service Environment). * @@ -1569,16 +1940,101 @@ public ServiceResponse getHostingEnvironmentMultiRoleM * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @param startTime Beginning time of metrics query - * @param endTime End time of metrics query - * @param timeGrain Time granularity of metrics query - * @param details Include instance details - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * @param startTime Beginning time of metrics query + * @param endTime End time of metrics query + * @param timeGrain Time granularity of metrics query + * @param details Include instance details + * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getHostingEnvironmentMultiRoleMetricsAsync(String resourceGroupName, String name, String startTime, String endTime, String timeGrain, Boolean details, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.getHostingEnvironmentMultiRoleMetrics(resourceGroupName, name, this.client.getSubscriptionId(), startTime, endTime, timeGrain, details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getHostingEnvironmentMultiRoleMetricsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getHostingEnvironmentMultiRoleMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get metrics for a worker pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getHostingEnvironmentWebWorkerMetrics(String resourceGroupName, String name, String workerPoolName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (workerPoolName == null) { + throw new IllegalArgumentException("Parameter workerPoolName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Boolean details = null; + String filter = null; + Call call = service.getHostingEnvironmentWebWorkerMetrics(resourceGroupName, name, workerPoolName, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getHostingEnvironmentWebWorkerMetricsDelegate(call.execute()); + } + + /** + * Get metrics for a worker pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getHostingEnvironmentMultiRoleMetricsAsync(String resourceGroupName, String name, String startTime, String endTime, String timeGrain, Boolean details, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getHostingEnvironmentWebWorkerMetricsAsync(String resourceGroupName, String name, String workerPoolName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -1590,6 +2046,10 @@ public ServiceCall getHostingEnvironmentMultiRoleMetricsAsync(String resourceGro serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (workerPoolName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; @@ -1598,13 +2058,15 @@ public ServiceCall getHostingEnvironmentMultiRoleMetricsAsync(String resourceGro serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getHostingEnvironmentMultiRoleMetrics(resourceGroupName, name, this.client.getSubscriptionId(), startTime, endTime, timeGrain, details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final Boolean details = null; + final String filter = null; + Call call = service.getHostingEnvironmentWebWorkerMetrics(resourceGroupName, name, workerPoolName, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getHostingEnvironmentMultiRoleMetricsDelegate(response)); + serviceCallback.success(getHostingEnvironmentWebWorkerMetricsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -1613,13 +2075,6 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getHostingEnvironmentMultiRoleMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** * Get metrics for a worker pool of a hostingEnvironment (App Service Environment). * @@ -2041,6 +2496,79 @@ private ServiceResponse getHostingEnvironmentWebWorkerUsagesDel .build(response); } + /** + * Get all sites on the hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the SiteCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getHostingEnvironmentSites(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String propertiesToInclude = null; + Call call = service.getHostingEnvironmentSites(resourceGroupName, name, this.client.getSubscriptionId(), propertiesToInclude, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getHostingEnvironmentSitesDelegate(call.execute()); + } + + /** + * Get all sites on the hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getHostingEnvironmentSitesAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String propertiesToInclude = null; + Call call = service.getHostingEnvironmentSites(resourceGroupName, name, this.client.getSubscriptionId(), propertiesToInclude, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getHostingEnvironmentSitesDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Get all sites on the hostingEnvironment (App Service Environment). * @@ -3122,6 +3650,99 @@ private ServiceResponse getWorkerPoolSkusDelegate(Response getWorkerPoolInstanceMetrics(String resourceGroupName, String name, String workerPoolName, String instance) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (workerPoolName == null) { + throw new IllegalArgumentException("Parameter workerPoolName is required and cannot be null."); + } + if (instance == null) { + throw new IllegalArgumentException("Parameter instance is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Boolean details = null; + String filter = null; + Call call = service.getWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, instance, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getWorkerPoolInstanceMetricsDelegate(call.execute()); + } + + /** + * Get metrics for a specific instance of a worker pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @param instance Name of instance in the worker pool + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getWorkerPoolInstanceMetricsAsync(String resourceGroupName, String name, String workerPoolName, String instance, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (workerPoolName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); + return null; + } + if (instance == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter instance is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Boolean details = null; + final String filter = null; + Call call = service.getWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, instance, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getWorkerPoolInstanceMetricsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Get metrics for a specific instance of a worker pool of a hostingEnvironment (App Service Environment). * @@ -3318,6 +3939,88 @@ private ServiceResponse getWorkerPoolInstanceMetricDefinitionsDelegate(R .build(response); } + /** + * Get metrics for a specific instance of a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param instance Name of instance in the multiRole pool + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getMultiRolePoolInstanceMetrics(String resourceGroupName, String name, String instance) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (instance == null) { + throw new IllegalArgumentException("Parameter instance is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Boolean details = null; + Call call = service.getMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, this.client.getSubscriptionId(), details, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getMultiRolePoolInstanceMetricsDelegate(call.execute()); + } + + /** + * Get metrics for a specific instance of a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param instance Name of instance in the multiRole pool + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getMultiRolePoolInstanceMetricsAsync(String resourceGroupName, String name, String instance, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (instance == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter instance is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Boolean details = null; + Call call = service.getMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, this.client.getSubscriptionId(), details, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getMultiRolePoolInstanceMetricsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Get metrics for a specific instance of a multiRole pool of a hostingEnvironment (App Service Environment). * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ManagedHostingEnvironmentsOperations.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ManagedHostingEnvironmentsOperations.java index d55b74e95816..1458c92510ee 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ManagedHostingEnvironmentsOperations.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ManagedHostingEnvironmentsOperations.java @@ -101,6 +101,29 @@ public interface ManagedHostingEnvironmentsOperations { */ ServiceCall beginCreateOrUpdateManagedHostingEnvironmentAsync(String resourceGroupName, String name, HostingEnvironment managedHostingEnvironmentEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Delete a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse deleteManagedHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * Delete a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall deleteManagedHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Delete a managed hosting environment. * @@ -127,6 +150,28 @@ public interface ManagedHostingEnvironmentsOperations { */ ServiceCall deleteManagedHostingEnvironmentAsync(String resourceGroupName, String name, Boolean forceDelete, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Delete a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse beginDeleteManagedHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Delete a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginDeleteManagedHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Delete a managed hosting environment. * @@ -221,6 +266,28 @@ public interface ManagedHostingEnvironmentsOperations { */ ServiceCall getManagedHostingEnvironmentOperationAsync(String resourceGroupName, String name, String operationId, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get all sites on the managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the SiteCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getManagedHostingEnvironmentSites(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get all sites on the managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getManagedHostingEnvironmentSitesAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Get all sites on the managed hosting environment. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ManagedHostingEnvironmentsOperationsImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ManagedHostingEnvironmentsOperationsImpl.java index 17587b4be500..277099097013 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ManagedHostingEnvironmentsOperationsImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ManagedHostingEnvironmentsOperationsImpl.java @@ -359,6 +359,75 @@ private ServiceResponse beginCreateOrUpdateManagedHostingEnv .build(response); } + /** + * Delete a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the Object object wrapped in ServiceResponse if successful. + */ + public ServiceResponse deleteManagedHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + final Boolean forceDelete = null; + Response result = service.deleteManagedHostingEnvironment(resourceGroupName, name, this.client.getSubscriptionId(), forceDelete, this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); + } + + /** + * Delete a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall deleteManagedHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + final Boolean forceDelete = null; + Call call = service.deleteManagedHostingEnvironment(resourceGroupName, name, this.client.getSubscriptionId(), forceDelete, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } /** * Delete a managed hosting environment. * @@ -429,6 +498,79 @@ public void onResponse(Call call, Response response) return serviceCall; } + /** + * Delete a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse beginDeleteManagedHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Boolean forceDelete = null; + Call call = service.beginDeleteManagedHostingEnvironment(resourceGroupName, name, this.client.getSubscriptionId(), forceDelete, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginDeleteManagedHostingEnvironmentDelegate(call.execute()); + } + + /** + * Delete a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginDeleteManagedHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Boolean forceDelete = null; + Call call = service.beginDeleteManagedHostingEnvironment(resourceGroupName, name, this.client.getSubscriptionId(), forceDelete, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginDeleteManagedHostingEnvironmentDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Delete a managed hosting environment. * @@ -749,6 +891,79 @@ private ServiceResponse getManagedHostingEnvironmentOperationDelegate(Re .build(response); } + /** + * Get all sites on the managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the SiteCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getManagedHostingEnvironmentSites(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String propertiesToInclude = null; + Call call = service.getManagedHostingEnvironmentSites(resourceGroupName, name, this.client.getSubscriptionId(), propertiesToInclude, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getManagedHostingEnvironmentSitesDelegate(call.execute()); + } + + /** + * Get all sites on the managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getManagedHostingEnvironmentSitesAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String propertiesToInclude = null; + Call call = service.getManagedHostingEnvironmentSites(resourceGroupName, name, this.client.getSubscriptionId(), propertiesToInclude, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getManagedHostingEnvironmentSitesDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Get all sites on the managed hosting environment. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/RecommendationsOperations.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/RecommendationsOperations.java index 722c281eb4e2..e21ee8c66d6a 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/RecommendationsOperations.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/RecommendationsOperations.java @@ -24,6 +24,24 @@ * in RecommendationsOperations. */ public interface RecommendationsOperations { + /** + * Gets a list of recommendations associated with the specified subscription. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<Recommendation> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> getRecommendationBySubscription() throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets a list of recommendations associated with the specified subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getRecommendationBySubscriptionAsync(final ServiceCallback> serviceCallback) throws IllegalArgumentException; /** * Gets a list of recommendations associated with the specified subscription. * @@ -72,6 +90,28 @@ public interface RecommendationsOperations { */ ServiceCall getRuleDetailsBySiteNameAsync(String resourceGroupName, String siteName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets a list of recommendations associated with the specified web site. + * + * @param resourceGroupName Resource group name + * @param siteName Site name + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<Recommendation> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> getRecommendedRulesForSite(String resourceGroupName, String siteName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets a list of recommendations associated with the specified web site. + * + * @param resourceGroupName Resource group name + * @param siteName Site name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getRecommendedRulesForSiteAsync(String resourceGroupName, String siteName, final ServiceCallback> serviceCallback) throws IllegalArgumentException; /** * Gets a list of recommendations associated with the specified web site. * @@ -97,6 +137,28 @@ public interface RecommendationsOperations { */ ServiceCall getRecommendedRulesForSiteAsync(String resourceGroupName, String siteName, Boolean featured, final ServiceCallback> serviceCallback) throws IllegalArgumentException; + /** + * Gets the list of past recommendations optionally specified by the time range. + * + * @param resourceGroupName Resource group name + * @param siteName Site name + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<Recommendation> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> getRecommendationHistoryForSite(String resourceGroupName, String siteName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the list of past recommendations optionally specified by the time range. + * + * @param resourceGroupName Resource group name + * @param siteName Site name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getRecommendationHistoryForSiteAsync(String resourceGroupName, String siteName, final ServiceCallback> serviceCallback) throws IllegalArgumentException; /** * Gets the list of past recommendations optionally specified by the time range. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/RecommendationsOperationsImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/RecommendationsOperationsImpl.java index 95c6d00a7c73..6a28d1ca6857 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/RecommendationsOperationsImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/RecommendationsOperationsImpl.java @@ -75,6 +75,63 @@ interface RecommendationsService { } + /** + * Gets a list of recommendations associated with the specified subscription. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<Recommendation> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> getRecommendationBySubscription() throws CloudException, IOException, IllegalArgumentException { + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Boolean featured = null; + String filter = null; + Call call = service.getRecommendationBySubscription(this.client.getSubscriptionId(), featured, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getRecommendationBySubscriptionDelegate(call.execute()); + } + + /** + * Gets a list of recommendations associated with the specified subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getRecommendationBySubscriptionAsync(final ServiceCallback> serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Boolean featured = null; + final String filter = null; + Call call = service.getRecommendationBySubscription(this.client.getSubscriptionId(), featured, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getRecommendationBySubscriptionDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets a list of recommendations associated with the specified subscription. * @@ -226,6 +283,79 @@ private ServiceResponse getRuleDetailsBySiteNameDelegate(Res .build(response); } + /** + * Gets a list of recommendations associated with the specified web site. + * + * @param resourceGroupName Resource group name + * @param siteName Site name + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<Recommendation> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> getRecommendedRulesForSite(String resourceGroupName, String siteName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (siteName == null) { + throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Boolean featured = null; + Call call = service.getRecommendedRulesForSite(resourceGroupName, siteName, this.client.getSubscriptionId(), featured, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getRecommendedRulesForSiteDelegate(call.execute()); + } + + /** + * Gets a list of recommendations associated with the specified web site. + * + * @param resourceGroupName Resource group name + * @param siteName Site name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getRecommendedRulesForSiteAsync(String resourceGroupName, String siteName, final ServiceCallback> serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (siteName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Boolean featured = null; + Call call = service.getRecommendedRulesForSite(resourceGroupName, siteName, this.client.getSubscriptionId(), featured, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getRecommendedRulesForSiteDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets a list of recommendations associated with the specified web site. * @@ -306,6 +436,81 @@ private ServiceResponse> getRecommendedRulesForSiteDelegate .build(response); } + /** + * Gets the list of past recommendations optionally specified by the time range. + * + * @param resourceGroupName Resource group name + * @param siteName Site name + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<Recommendation> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> getRecommendationHistoryForSite(String resourceGroupName, String siteName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (siteName == null) { + throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String startTime = null; + String endTime = null; + Call call = service.getRecommendationHistoryForSite(resourceGroupName, siteName, this.client.getSubscriptionId(), startTime, endTime, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getRecommendationHistoryForSiteDelegate(call.execute()); + } + + /** + * Gets the list of past recommendations optionally specified by the time range. + * + * @param resourceGroupName Resource group name + * @param siteName Site name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getRecommendationHistoryForSiteAsync(String resourceGroupName, String siteName, final ServiceCallback> serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (siteName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String startTime = null; + final String endTime = null; + Call call = service.getRecommendationHistoryForSite(resourceGroupName, siteName, this.client.getSubscriptionId(), startTime, endTime, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getRecommendationHistoryForSiteDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets the list of past recommendations optionally specified by the time range. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ServerFarmsOperations.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ServerFarmsOperations.java index d8a7cddc04c5..a429d24a1937 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ServerFarmsOperations.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ServerFarmsOperations.java @@ -76,6 +76,31 @@ public interface ServerFarmsOperations { */ ServiceCall getServerFarmAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serverFarmEnvelope Details of App Service Plan + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the ServerFarmWithRichSku object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse createOrUpdateServerFarm(String resourceGroupName, String name, ServerFarmWithRichSku serverFarmEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serverFarmEnvelope Details of App Service Plan + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall createOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSku serverFarmEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Creates or updates an App Service Plan. * @@ -104,6 +129,30 @@ public interface ServerFarmsOperations { */ ServiceCall createOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSku serverFarmEnvelope, Boolean allowPendingState, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serverFarmEnvelope Details of App Service Plan + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ServerFarmWithRichSku object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse beginCreateOrUpdateServerFarm(String resourceGroupName, String name, ServerFarmWithRichSku serverFarmEnvelope) throws CloudException, IOException, IllegalArgumentException; + + /** + * Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serverFarmEnvelope Details of App Service Plan + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginCreateOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSku serverFarmEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Creates or updates an App Service Plan. * @@ -154,6 +203,28 @@ public interface ServerFarmsOperations { */ ServiceCall deleteServerFarmAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Queries for App Serice Plan metrics. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getServerFarmMetrics(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Queries for App Serice Plan metrics. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getServerFarmMetricsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Queries for App Serice Plan metrics. * @@ -445,6 +516,28 @@ public interface ServerFarmsOperations { */ ServiceCall updateServerFarmVnetGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGateway connectionEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets list of Apps associated with an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<Site> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> getServerFarmSites(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets list of Apps associated with an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getServerFarmSitesAsync(final String resourceGroupName, final String name, final ListOperationCallback serviceCallback) throws IllegalArgumentException; /** * Gets list of Apps associated with an App Service Plan. * @@ -499,6 +592,28 @@ public interface ServerFarmsOperations { */ ServiceCall rebootWorkerForServerFarmAsync(String resourceGroupName, String name, String workerName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Restarts web apps in a specified App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse restartSitesForServerFarm(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Restarts web apps in a specified App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall restartSitesForServerFarmAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Restarts web apps in a specified App Service Plan. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ServerFarmsOperationsImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ServerFarmsOperationsImpl.java index 9bfe0aaca0cc..d17452283781 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ServerFarmsOperationsImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/ServerFarmsOperationsImpl.java @@ -306,6 +306,85 @@ private ServiceResponse getServerFarmDelegate(Response createOrUpdateServerFarm(String resourceGroupName, String name, ServerFarmWithRichSku serverFarmEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (serverFarmEnvelope == null) { + throw new IllegalArgumentException("Parameter serverFarmEnvelope is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(serverFarmEnvelope); + final Boolean allowPendingState = null; + Response result = service.createOrUpdateServerFarm(resourceGroupName, name, this.client.getSubscriptionId(), serverFarmEnvelope, allowPendingState, this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPutOrPatchResult(result, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serverFarmEnvelope Details of App Service Plan + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall createOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSku serverFarmEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (serverFarmEnvelope == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter serverFarmEnvelope is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + Validator.validate(serverFarmEnvelope, serviceCallback); + final Boolean allowPendingState = null; + Call call = service.createOrUpdateServerFarm(resourceGroupName, name, this.client.getSubscriptionId(), serverFarmEnvelope, allowPendingState, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPutOrPatchResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } /** * Creates or updates an App Service Plan. * @@ -386,6 +465,90 @@ public void onResponse(Call call, Response response) return serviceCall; } + /** + * Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serverFarmEnvelope Details of App Service Plan + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ServerFarmWithRichSku object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse beginCreateOrUpdateServerFarm(String resourceGroupName, String name, ServerFarmWithRichSku serverFarmEnvelope) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (serverFarmEnvelope == null) { + throw new IllegalArgumentException("Parameter serverFarmEnvelope is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(serverFarmEnvelope); + Boolean allowPendingState = null; + Call call = service.beginCreateOrUpdateServerFarm(resourceGroupName, name, this.client.getSubscriptionId(), serverFarmEnvelope, allowPendingState, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginCreateOrUpdateServerFarmDelegate(call.execute()); + } + + /** + * Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serverFarmEnvelope Details of App Service Plan + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginCreateOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSku serverFarmEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (serverFarmEnvelope == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter serverFarmEnvelope is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(serverFarmEnvelope, serviceCallback); + final Boolean allowPendingState = null; + Call call = service.beginCreateOrUpdateServerFarm(resourceGroupName, name, this.client.getSubscriptionId(), serverFarmEnvelope, allowPendingState, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginCreateOrUpdateServerFarmDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Creates or updates an App Service Plan. * @@ -556,6 +719,81 @@ private ServiceResponse deleteServerFarmDelegate(Response .build(response); } + /** + * Queries for App Serice Plan metrics. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getServerFarmMetrics(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Boolean details = null; + String filter = null; + Call call = service.getServerFarmMetrics(resourceGroupName, name, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getServerFarmMetricsDelegate(call.execute()); + } + + /** + * Queries for App Serice Plan metrics. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getServerFarmMetricsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Boolean details = null; + final String filter = null; + Call call = service.getServerFarmMetrics(resourceGroupName, name, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getServerFarmMetricsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Queries for App Serice Plan metrics. * @@ -1584,6 +1822,96 @@ private ServiceResponse updateServerFarmVnetGatewayDelegate(Respons .build(response); } + /** + * Gets list of Apps associated with an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<Site> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> getServerFarmSites(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String skipToken = null; + String filter = null; + String top = null; + Call call = service.getServerFarmSites(resourceGroupName, name, this.client.getSubscriptionId(), skipToken, filter, top, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = getServerFarmSitesDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = getServerFarmSitesNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets list of Apps associated with an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getServerFarmSitesAsync(final String resourceGroupName, final String name, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String skipToken = null; + final String filter = null; + final String top = null; + Call call = service.getServerFarmSites(resourceGroupName, name, this.client.getSubscriptionId(), skipToken, filter, top, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = getServerFarmSitesDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + getServerFarmSitesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets list of Apps associated with an App Service Plan. * @@ -1768,6 +2096,79 @@ private ServiceResponse rebootWorkerForServerFarmDelegate(Response restartSitesForServerFarm(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Boolean softRestart = null; + Call call = service.restartSitesForServerFarm(resourceGroupName, name, this.client.getSubscriptionId(), softRestart, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return restartSitesForServerFarmDelegate(call.execute()); + } + + /** + * Restarts web apps in a specified App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall restartSitesForServerFarmAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Boolean softRestart = null; + Call call = service.restartSitesForServerFarm(resourceGroupName, name, this.client.getSubscriptionId(), softRestart, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(restartSitesForServerFarmDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Restarts web apps in a specified App Service Plan. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/SitesOperations.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/SitesOperations.java index 7136dcb2b532..b2c21a7c885d 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/SitesOperations.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/SitesOperations.java @@ -628,6 +628,28 @@ public interface SitesOperations { */ ServiceCall updateSlotConfigNamesAsync(String resourceGroupName, String name, SlotConfigNamesResource slotConfigNames, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets all the slots for a web apps. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the SiteCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getSiteSlots(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets all the slots for a web apps. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getSiteSlotsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Gets all the slots for a web apps. * @@ -653,6 +675,26 @@ public interface SitesOperations { */ ServiceCall getSiteSlotsAsync(String resourceGroupName, String name, String propertiesToInclude, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets the web apps for a subscription in the specified resource group. + * + * @param resourceGroupName Name of resource group + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the SiteCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getSites(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the web apps for a subscription in the specified resource group. + * + * @param resourceGroupName Name of resource group + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getSitesAsync(String resourceGroupName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Gets the web apps for a subscription in the specified resource group. * @@ -680,6 +722,28 @@ public interface SitesOperations { */ ServiceCall getSitesAsync(String resourceGroupName, String propertiesToInclude, String includeSiteTypes, Boolean includeSlots, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get details of a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Site object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get details of a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getSiteAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Get details of a web app. * @@ -705,6 +769,31 @@ public interface SitesOperations { */ ServiceCall getSiteAsync(String resourceGroupName, String name, String propertiesToInclude, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param siteEnvelope Details of web app if it exists already + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the Site object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse createOrUpdateSite(String resourceGroupName, String name, Site siteEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param siteEnvelope Details of web app if it exists already + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall createOrUpdateSiteAsync(String resourceGroupName, String name, Site siteEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Creates a new web app or modifies an existing web app. * @@ -741,6 +830,30 @@ public interface SitesOperations { */ ServiceCall createOrUpdateSiteAsync(String resourceGroupName, String name, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param siteEnvelope Details of web app if it exists already + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Site object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse beginCreateOrUpdateSite(String resourceGroupName, String name, Site siteEnvelope) throws CloudException, IOException, IllegalArgumentException; + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param siteEnvelope Details of web app if it exists already + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginCreateOrUpdateSiteAsync(String resourceGroupName, String name, Site siteEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Creates a new web app or modifies an existing web app. * @@ -776,6 +889,28 @@ public interface SitesOperations { */ ServiceCall beginCreateOrUpdateSiteAsync(String resourceGroupName, String name, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Deletes a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse deleteSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Deletes a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall deleteSiteAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Deletes a web app. * @@ -807,6 +942,30 @@ public interface SitesOperations { */ ServiceCall deleteSiteAsync(String resourceGroupName, String name, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get details of a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Site object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get details of a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getSiteSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Get details of a web app. * @@ -834,6 +993,33 @@ public interface SitesOperations { */ ServiceCall getSiteSlotAsync(String resourceGroupName, String name, String slot, String propertiesToInclude, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteEnvelope Details of web app if it exists already + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the Site object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse createOrUpdateSiteSlot(String resourceGroupName, String name, String slot, Site siteEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteEnvelope Details of web app if it exists already + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall createOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, Site siteEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Creates a new web app or modifies an existing web app. * @@ -872,6 +1058,32 @@ public interface SitesOperations { */ ServiceCall createOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteEnvelope Details of web app if it exists already + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Site object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse beginCreateOrUpdateSiteSlot(String resourceGroupName, String name, String slot, Site siteEnvelope) throws CloudException, IOException, IllegalArgumentException; + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteEnvelope Details of web app if it exists already + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginCreateOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, Site siteEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Creates a new web app or modifies an existing web app. * @@ -909,6 +1121,30 @@ public interface SitesOperations { */ ServiceCall beginCreateOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Deletes a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse deleteSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException; + + /** + * Deletes a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall deleteSiteSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Deletes a web app. * @@ -1154,6 +1390,26 @@ public interface SitesOperations { */ ServiceCall getSiteSnapshotsSlotAsync(String name, String resourceGroupName, String slot, String subscriptionName, String webspaceName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets deleted web apps in subscription. + * + * @param resourceGroupName Name of resource group + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DeletedSiteCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getDeletedSites(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets deleted web apps in subscription. + * + * @param resourceGroupName Name of resource group + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getDeletedSitesAsync(String resourceGroupName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Gets deleted web apps in subscription. * @@ -3477,6 +3733,30 @@ public interface SitesOperations { */ ServiceCall restoreSiteSlotAsync(String resourceGroupName, String name, String backupId, String slot, RestoreRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets the quota usage numbers for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the CsmUsageQuotaCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getSiteUsagesSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the quota usage numbers for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getSiteUsagesSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Gets the quota usage numbers for web app. * @@ -3504,6 +3784,28 @@ public interface SitesOperations { */ ServiceCall getSiteUsagesSlotAsync(String resourceGroupName, String name, String slot, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets the quota usage numbers for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the CsmUsageQuotaCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getSiteUsages(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the quota usage numbers for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getSiteUsagesAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Gets the quota usage numbers for web app. * @@ -3529,6 +3831,30 @@ public interface SitesOperations { */ ServiceCall getSiteUsagesAsync(String resourceGroupName, String name, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets metrics for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getSiteMetricsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets metrics for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getSiteMetricsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Gets metrics for web app. * @@ -3558,6 +3884,28 @@ public interface SitesOperations { */ ServiceCall getSiteMetricsSlotAsync(String resourceGroupName, String name, String slot, Boolean details, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets metrics for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getSiteMetrics(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets metrics for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getSiteMetricsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Gets metrics for web app. * @@ -3633,6 +3981,28 @@ public interface SitesOperations { */ ServiceCall getSiteMetricDefinitionsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets the publishing profile for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the InputStream object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse listSitePublishingProfileXml(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the publishing profile for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listSitePublishingProfileXmlAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Gets the publishing profile for web app. * @@ -3664,6 +4034,30 @@ public interface SitesOperations { */ ServiceCall listSitePublishingProfileXmlAsync(String resourceGroupName, String name, String format, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets the publishing profile for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the InputStream object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse listSitePublishingProfileXmlSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the publishing profile for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listSitePublishingProfileXmlSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Gets the publishing profile for web app. * @@ -3697,6 +4091,28 @@ public interface SitesOperations { */ ServiceCall listSitePublishingProfileXmlSlotAsync(String resourceGroupName, String name, String slot, String format, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Restarts web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse restartSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Restarts web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall restartSiteAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Restarts web app. * @@ -3724,6 +4140,30 @@ public interface SitesOperations { */ ServiceCall restartSiteAsync(String resourceGroupName, String name, Boolean softRestart, Boolean synchronous, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Restarts web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse restartSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException; + + /** + * Restarts web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall restartSiteSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Restarts web app. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/SitesOperationsImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/SitesOperationsImpl.java index 72362346d6c7..4beb25f7799f 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/SitesOperationsImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/SitesOperationsImpl.java @@ -2806,6 +2806,79 @@ private ServiceResponse updateSlotConfigNamesDelegate(R .build(response); } + /** + * Gets all the slots for a web apps. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the SiteCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getSiteSlots(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String propertiesToInclude = null; + Call call = service.getSiteSlots(resourceGroupName, name, this.client.getSubscriptionId(), propertiesToInclude, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteSlotsDelegate(call.execute()); + } + + /** + * Gets all the slots for a web apps. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getSiteSlotsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String propertiesToInclude = null; + Call call = service.getSiteSlots(resourceGroupName, name, this.client.getSubscriptionId(), propertiesToInclude, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getSiteSlotsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets all the slots for a web apps. * @@ -2886,6 +2959,74 @@ private ServiceResponse getSiteSlotsDelegate(Response getSites(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String propertiesToInclude = null; + String includeSiteTypes = null; + Boolean includeSlots = null; + Call call = service.getSites(resourceGroupName, this.client.getSubscriptionId(), propertiesToInclude, includeSiteTypes, includeSlots, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSitesDelegate(call.execute()); + } + + /** + * Gets the web apps for a subscription in the specified resource group. + * + * @param resourceGroupName Name of resource group + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getSitesAsync(String resourceGroupName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String propertiesToInclude = null; + final String includeSiteTypes = null; + final Boolean includeSlots = null; + Call call = service.getSites(resourceGroupName, this.client.getSubscriptionId(), propertiesToInclude, includeSiteTypes, includeSlots, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getSitesDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Gets the web apps for a subscription in the specified resource group. * @@ -2961,6 +3102,79 @@ private ServiceResponse getSitesDelegate(Response .build(response); } + /** + * Get details of a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Site object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String propertiesToInclude = null; + Call call = service.getSite(resourceGroupName, name, this.client.getSubscriptionId(), propertiesToInclude, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteDelegate(call.execute()); + } + + /** + * Get details of a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getSiteAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String propertiesToInclude = null; + Call call = service.getSite(resourceGroupName, name, this.client.getSubscriptionId(), propertiesToInclude, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getSiteDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Get details of a web app. * @@ -3047,18 +3261,13 @@ private ServiceResponse getSiteDelegate(Response response) t * @param resourceGroupName Name of the resource group * @param name Name of the web app * @param siteEnvelope Details of web app if it exists already - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS - * @param ttlInSeconds Time to live in seconds for web app's default domain name * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted * @return the Site object wrapped in ServiceResponse if successful. */ - public ServiceResponse createOrUpdateSite(String resourceGroupName, String name, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + public ServiceResponse createOrUpdateSite(String resourceGroupName, String name, Site siteEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3075,6 +3284,10 @@ public ServiceResponse createOrUpdateSite(String resourceGroupName, String throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } Validator.validate(siteEnvelope); + final String skipDnsRegistration = null; + final String skipCustomDomainVerification = null; + final String forceDnsRegistration = null; + final String ttlInSeconds = null; Response result = service.createOrUpdateSite(resourceGroupName, name, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); return client.getAzureClient().getPutOrPatchResult(result, new TypeToken() { }.getType()); } @@ -3085,16 +3298,11 @@ public ServiceResponse createOrUpdateSite(String resourceGroupName, String * @param resourceGroupName Name of the resource group * @param name Name of the web app * @param siteEnvelope Details of web app if it exists already - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS - * @param ttlInSeconds Time to live in seconds for web app's default domain name * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link ServiceCall} object */ - public ServiceCall createOrUpdateSiteAsync(String resourceGroupName, String name, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createOrUpdateSiteAsync(String resourceGroupName, String name, Site siteEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -3114,6 +3322,10 @@ public ServiceCall createOrUpdateSiteAsync(String resourceGroupName, String name serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); } Validator.validate(siteEnvelope, serviceCallback); + final String skipDnsRegistration = null; + final String skipCustomDomainVerification = null; + final String forceDnsRegistration = null; + final String ttlInSeconds = null; Call call = service.createOrUpdateSite(resourceGroupName, name, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue(new Callback() { @@ -3128,7 +3340,6 @@ public void onResponse(Call call, Response response) }); return serviceCall; } - /** * Creates a new web app or modifies an existing web app. * @@ -3143,9 +3354,10 @@ public void onResponse(Call call, Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Site object wrapped in {@link ServiceResponse} if successful. + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the Site object wrapped in ServiceResponse if successful. */ - public ServiceResponse beginCreateOrUpdateSite(String resourceGroupName, String name, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse createOrUpdateSite(String resourceGroupName, String name, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3162,8 +3374,8 @@ public ServiceResponse beginCreateOrUpdateSite(String resourceGroupName, S throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } Validator.validate(siteEnvelope); - Call call = service.beginCreateOrUpdateSite(resourceGroupName, name, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return beginCreateOrUpdateSiteDelegate(call.execute()); + Response result = service.createOrUpdateSite(resourceGroupName, name, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPutOrPatchResult(result, new TypeToken() { }.getType()); } /** @@ -3179,71 +3391,55 @@ public ServiceResponse beginCreateOrUpdateSite(String resourceGroupName, S * @param ttlInSeconds Time to live in seconds for web app's default domain name * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null - * @return the {@link Call} object + * @return the {@link ServiceCall} object */ - public ServiceCall beginCreateOrUpdateSiteAsync(String resourceGroupName, String name, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createOrUpdateSiteAsync(String resourceGroupName, String name, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } if (resourceGroupName == null) { serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - return null; } if (name == null) { serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); - return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); - return null; } if (siteEnvelope == null) { serviceCallback.failure(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); - return null; } Validator.validate(siteEnvelope, serviceCallback); - Call call = service.beginCreateOrUpdateSite(resourceGroupName, name, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.createOrUpdateSite(resourceGroupName, name, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } @Override public void onResponse(Call call, Response response) { - try { - serviceCallback.success(beginCreateOrUpdateSiteDelegate(response)); - } catch (CloudException | IOException exception) { - serviceCallback.failure(exception); - } + client.getAzureClient().getPutOrPatchResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); } }); return serviceCall; } - private ServiceResponse beginCreateOrUpdateSiteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** - * Deletes a web app. + * Creates a new web app or modifies an existing web app. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param deleteMetrics If true, web app metrics are also deleted - * @param deleteEmptyServerFarm If true and App Service Plan is empty after web app deletion, App Service Plan is also deleted - * @param skipDnsRegistration If true, DNS registration is skipped - * @param deleteAllSlots If true, all slots associated with web app are also deleted + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param siteEnvelope Details of web app if it exists already * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Site object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse deleteSite(String resourceGroupName, String name, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse beginCreateOrUpdateSite(String resourceGroupName, String name, Site siteEnvelope) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3253,27 +3449,32 @@ public ServiceResponse deleteSite(String resourceGroupName, String name, if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (siteEnvelope == null) { + throw new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.deleteSite(resourceGroupName, name, this.client.getSubscriptionId(), deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return deleteSiteDelegate(call.execute()); + Validator.validate(siteEnvelope); + String skipDnsRegistration = null; + String skipCustomDomainVerification = null; + String forceDnsRegistration = null; + String ttlInSeconds = null; + Call call = service.beginCreateOrUpdateSite(resourceGroupName, name, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginCreateOrUpdateSiteDelegate(call.execute()); } /** - * Deletes a web app. + * Creates a new web app or modifies an existing web app. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param deleteMetrics If true, web app metrics are also deleted - * @param deleteEmptyServerFarm If true and App Service Plan is empty after web app deletion, App Service Plan is also deleted - * @param skipDnsRegistration If true, DNS registration is skipped - * @param deleteAllSlots If true, all slots associated with web app are also deleted + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param siteEnvelope Details of web app if it exists already * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall deleteSiteAsync(String resourceGroupName, String name, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall beginCreateOrUpdateSiteAsync(String resourceGroupName, String name, Site siteEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -3289,106 +3490,26 @@ public ServiceCall deleteSiteAsync(String resourceGroupName, String name, String serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (this.client.getApiVersion() == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); - return null; - } - Call call = service.deleteSite(resourceGroupName, name, this.client.getSubscriptionId(), deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots, this.client.getApiVersion(), this.client.getAcceptLanguage()); - final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { - @Override - public void onResponse(Call call, Response response) { - try { - serviceCallback.success(deleteSiteDelegate(response)); - } catch (CloudException | IOException exception) { - serviceCallback.failure(exception); - } - } - }); - return serviceCall; - } - - private ServiceResponse deleteSiteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - - /** - * Get details of a web app. - * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param propertiesToInclude Additional web app properties included in the response - * @throws CloudException exception thrown from REST call - * @throws IOException exception thrown from serialization/deserialization - * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Site object wrapped in {@link ServiceResponse} if successful. - */ - public ServiceResponse getSiteSlot(String resourceGroupName, String name, String slot, String propertiesToInclude) throws CloudException, IOException, IllegalArgumentException { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (name == null) { - throw new IllegalArgumentException("Parameter name is required and cannot be null."); - } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } - if (this.client.getSubscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); - } - if (this.client.getApiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); - } - Call call = service.getSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), propertiesToInclude, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteSlotDelegate(call.execute()); - } - - /** - * Get details of a web app. - * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param propertiesToInclude Additional web app properties included in the response - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if callback is null - * @return the {@link Call} object - */ - public ServiceCall getSiteSlotAsync(String resourceGroupName, String name, String slot, String propertiesToInclude, final ServiceCallback serviceCallback) throws IllegalArgumentException { - if (serviceCallback == null) { - throw new IllegalArgumentException("ServiceCallback is required for async calls."); - } - if (resourceGroupName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - return null; - } - if (name == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); - return null; - } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } - if (this.client.getSubscriptionId() == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (siteEnvelope == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), propertiesToInclude, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteEnvelope, serviceCallback); + final String skipDnsRegistration = null; + final String skipCustomDomainVerification = null; + final String forceDnsRegistration = null; + final String ttlInSeconds = null; + Call call = service.beginCreateOrUpdateSite(resourceGroupName, name, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteSlotDelegate(response)); + serviceCallback.success(beginCreateOrUpdateSiteDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -3397,19 +3518,11 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** * Creates a new web app or modifies an existing web app. * * @param resourceGroupName Name of the resource group * @param name Name of the web app - * @param slot Name of web app slot. If not specified then will default to production slot. * @param siteEnvelope Details of web app if it exists already * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is only used for app creation @@ -3419,19 +3532,15 @@ private ServiceResponse getSiteSlotDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the Site object wrapped in ServiceResponse if successful. + * @return the Site object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse createOrUpdateSiteSlot(String resourceGroupName, String name, String slot, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + public ServiceResponse beginCreateOrUpdateSite(String resourceGroupName, String name, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } @@ -3442,8 +3551,8 @@ public ServiceResponse createOrUpdateSiteSlot(String resourceGroupName, St throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } Validator.validate(siteEnvelope); - Response result = service.createOrUpdateSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); - return client.getAzureClient().getPutOrPatchResult(result, new TypeToken() { }.getType()); + Call call = service.beginCreateOrUpdateSite(resourceGroupName, name, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginCreateOrUpdateSiteDelegate(call.execute()); } /** @@ -3451,7 +3560,6 @@ public ServiceResponse createOrUpdateSiteSlot(String resourceGroupName, St * * @param resourceGroupName Name of the resource group * @param name Name of the web app - * @param slot Name of web app slot. If not specified then will default to production slot. * @param siteEnvelope Details of web app if it exists already * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is only used for app creation @@ -3460,104 +3568,97 @@ public ServiceResponse createOrUpdateSiteSlot(String resourceGroupName, St * @param ttlInSeconds Time to live in seconds for web app's default domain name * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null - * @return the {@link ServiceCall} object + * @return the {@link Call} object */ - public ServiceCall createOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall beginCreateOrUpdateSiteAsync(String resourceGroupName, String name, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } if (resourceGroupName == null) { serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; } if (name == null) { serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; } if (siteEnvelope == null) { serviceCallback.failure(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); + return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; } Validator.validate(siteEnvelope, serviceCallback); - Call call = service.createOrUpdateSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.beginCreateOrUpdateSite(resourceGroupName, name, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new Callback() { - @Override - public void onFailure(Call call, Throwable t) { - serviceCallback.failure(t); - } + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { - client.getAzureClient().getPutOrPatchResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + try { + serviceCallback.success(beginCreateOrUpdateSiteDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } } }); return serviceCall; } + private ServiceResponse beginCreateOrUpdateSiteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** - * Creates a new web app or modifies an existing web app. + * Deletes a web app. * - * @param resourceGroupName Name of the resource group - * @param name Name of the web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteEnvelope Details of web app if it exists already - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS - * @param ttlInSeconds Time to live in seconds for web app's default domain name + * @param resourceGroupName Name of resource group + * @param name Name of web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Site object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse beginCreateOrUpdateSiteSlot(String resourceGroupName, String name, String slot, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse deleteSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (siteEnvelope == null) { - throw new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(siteEnvelope); - Call call = service.beginCreateOrUpdateSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return beginCreateOrUpdateSiteSlotDelegate(call.execute()); + String deleteMetrics = null; + String deleteEmptyServerFarm = null; + String skipDnsRegistration = null; + String deleteAllSlots = null; + Call call = service.deleteSite(resourceGroupName, name, this.client.getSubscriptionId(), deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteSiteDelegate(call.execute()); } /** - * Creates a new web app or modifies an existing web app. + * Deletes a web app. * - * @param resourceGroupName Name of the resource group - * @param name Name of the web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteEnvelope Details of web app if it exists already - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS - * @param ttlInSeconds Time to live in seconds for web app's default domain name + * @param resourceGroupName Name of resource group + * @param name Name of web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall beginCreateOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall deleteSiteAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -3569,30 +3670,25 @@ public ServiceCall beginCreateOrUpdateSiteSlotAsync(String resourceGroupName, St serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (siteEnvelope == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(siteEnvelope, serviceCallback); - Call call = service.beginCreateOrUpdateSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final String deleteMetrics = null; + final String deleteEmptyServerFarm = null; + final String skipDnsRegistration = null; + final String deleteAllSlots = null; + Call call = service.deleteSite(resourceGroupName, name, this.client.getSubscriptionId(), deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(beginCreateOrUpdateSiteSlotDelegate(response)); + serviceCallback.success(deleteSiteDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -3601,20 +3697,11 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse beginCreateOrUpdateSiteSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** * Deletes a web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. * @param deleteMetrics If true, web app metrics are also deleted * @param deleteEmptyServerFarm If true and App Service Plan is empty after web app deletion, App Service Plan is also deleted * @param skipDnsRegistration If true, DNS registration is skipped @@ -3624,24 +3711,21 @@ private ServiceResponse beginCreateOrUpdateSiteSlotDelegate(Response deleteSiteSlot(String resourceGroupName, String name, String slot, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse deleteSite(String resourceGroupName, String name, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.deleteSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return deleteSiteSlotDelegate(call.execute()); + Call call = service.deleteSite(resourceGroupName, name, this.client.getSubscriptionId(), deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteSiteDelegate(call.execute()); } /** @@ -3649,7 +3733,6 @@ public ServiceResponse deleteSiteSlot(String resourceGroupName, String n * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. * @param deleteMetrics If true, web app metrics are also deleted * @param deleteEmptyServerFarm If true and App Service Plan is empty after web app deletion, App Service Plan is also deleted * @param skipDnsRegistration If true, DNS registration is skipped @@ -3658,7 +3741,7 @@ public ServiceResponse deleteSiteSlot(String resourceGroupName, String n * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall deleteSiteSlotAsync(String resourceGroupName, String name, String slot, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall deleteSiteAsync(String resourceGroupName, String name, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -3670,10 +3753,6 @@ public ServiceCall deleteSiteSlotAsync(String resourceGroupName, String name, St serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; @@ -3682,13 +3761,13 @@ public ServiceCall deleteSiteSlotAsync(String resourceGroupName, String name, St serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.deleteSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.deleteSite(resourceGroupName, name, this.client.getSubscriptionId(), deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(deleteSiteSlotDelegate(response)); + serviceCallback.success(deleteSiteDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -3697,7 +3776,7 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse deleteSiteSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse deleteSiteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) @@ -3705,42 +3784,48 @@ private ServiceResponse deleteSiteSlotDelegate(Response re } /** - * Creates a new web app or modifies an existing web app. + * Get details of a web app. * - * @param resourceGroupName Name of the resource group - * @param name Name of the web app + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteCloneability object wrapped in {@link ServiceResponse} if successful. + * @return the Site object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse isSiteCloneable(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.isSiteCloneable(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return isSiteCloneableDelegate(call.execute()); + String propertiesToInclude = null; + Call call = service.getSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), propertiesToInclude, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteSlotDelegate(call.execute()); } /** - * Creates a new web app or modifies an existing web app. + * Get details of a web app. * - * @param resourceGroupName Name of the resource group - * @param name Name of the web app + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall isSiteCloneableAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -3752,6 +3837,10 @@ public ServiceCall isSiteCloneableAsync(String resourceGroupName, String name, f serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; @@ -3760,13 +3849,14 @@ public ServiceCall isSiteCloneableAsync(String resourceGroupName, String name, f serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.isSiteCloneable(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final String propertiesToInclude = null; + Call call = service.getSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), propertiesToInclude, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(isSiteCloneableDelegate(response)); + serviceCallback.success(getSiteSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -3775,25 +3865,19 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse isSiteCloneableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** - * Creates a new web app or modifies an existing web app. + * Get details of a web app. * - * @param resourceGroupName Name of the resource group - * @param name Name of the web app + * @param resourceGroupName Name of resource group + * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. + * @param propertiesToInclude Additional web app properties included in the response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteCloneability object wrapped in {@link ServiceResponse} if successful. + * @return the Site object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse isSiteCloneableSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteSlot(String resourceGroupName, String name, String slot, String propertiesToInclude) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3809,21 +3893,22 @@ public ServiceResponse isSiteCloneableSlot(String resourceGrou if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.isSiteCloneableSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return isSiteCloneableSlotDelegate(call.execute()); + Call call = service.getSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), propertiesToInclude, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteSlotDelegate(call.execute()); } /** - * Creates a new web app or modifies an existing web app. + * Get details of a web app. * - * @param resourceGroupName Name of the resource group - * @param name Name of the web app + * @param resourceGroupName Name of resource group + * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. + * @param propertiesToInclude Additional web app properties included in the response * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall isSiteCloneableSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteSlotAsync(String resourceGroupName, String name, String slot, String propertiesToInclude, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -3847,13 +3932,13 @@ public ServiceCall isSiteCloneableSlotAsync(String resourceGroupName, String nam serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.isSiteCloneableSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), propertiesToInclude, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(isSiteCloneableSlotDelegate(response)); + serviceCallback.success(getSiteSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -3862,115 +3947,125 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse isSiteCloneableSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Recovers a deleted web app. + * Creates a new web app or modifies an existing web app. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param snapshot Snapshot data used for web app recovery. Snapshot information can be obtained by call GetDeletedSites API. + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteEnvelope Details of web app if it exists already * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the Site object wrapped in ServiceResponse if successful. */ - public ServiceResponse recoverSite(String resourceGroupName, String name, CsmSiteRecoveryEntity snapshot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse createOrUpdateSiteSlot(String resourceGroupName, String name, String slot, Site siteEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (snapshot == null) { - throw new IllegalArgumentException("Parameter snapshot is required and cannot be null."); + if (siteEnvelope == null) { + throw new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(snapshot); - Call call = service.recoverSite(resourceGroupName, name, this.client.getSubscriptionId(), snapshot, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return recoverSiteDelegate(call.execute()); + Validator.validate(siteEnvelope); + final String skipDnsRegistration = null; + final String skipCustomDomainVerification = null; + final String forceDnsRegistration = null; + final String ttlInSeconds = null; + Response result = service.createOrUpdateSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPutOrPatchResult(result, new TypeToken() { }.getType()); } /** - * Recovers a deleted web app. + * Creates a new web app or modifies an existing web app. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param snapshot Snapshot data used for web app recovery. Snapshot information can be obtained by call GetDeletedSites API. + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteEnvelope Details of web app if it exists already * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null - * @return the {@link Call} object + * @return the {@link ServiceCall} object */ - public ServiceCall recoverSiteAsync(String resourceGroupName, String name, CsmSiteRecoveryEntity snapshot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, Site siteEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } if (resourceGroupName == null) { serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - return null; } if (name == null) { serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); - return null; + } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); - return null; } - if (snapshot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - return null; + if (siteEnvelope == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); - return null; } - Validator.validate(snapshot, serviceCallback); - Call call = service.recoverSite(resourceGroupName, name, this.client.getSubscriptionId(), snapshot, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteEnvelope, serviceCallback); + final String skipDnsRegistration = null; + final String skipCustomDomainVerification = null; + final String forceDnsRegistration = null; + final String ttlInSeconds = null; + Call call = service.createOrUpdateSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } @Override public void onResponse(Call call, Response response) { - try { - serviceCallback.success(recoverSiteDelegate(response)); - } catch (CloudException | IOException exception) { - serviceCallback.failure(exception); - } + client.getAzureClient().getPutOrPatchResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); } }); return serviceCall; } - - private ServiceResponse recoverSiteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** - * Recovers a deleted web app. + * Creates a new web app or modifies an existing web app. * - * @param resourceGroupName Name of resource group - * @param name Name of web app + * @param resourceGroupName Name of the resource group + * @param name Name of the web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param snapshot Snapshot data used for web app recovery. Snapshot information can be obtained by call GetDeletedSites API. + * @param siteEnvelope Details of web app if it exists already + * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is + only used for app creation + * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. + * @param forceDnsRegistration If true, web app hostname is force registered with DNS + * @param ttlInSeconds Time to live in seconds for web app's default domain name * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the Site object wrapped in ServiceResponse if successful. */ - public ServiceResponse recoverSiteSlot(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntity snapshot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse createOrUpdateSiteSlot(String resourceGroupName, String name, String slot, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3983,160 +4078,1688 @@ public ServiceResponse recoverSiteSlot(String resourceGroupName, String if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (snapshot == null) { - throw new IllegalArgumentException("Parameter snapshot is required and cannot be null."); + if (siteEnvelope == null) { + throw new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(snapshot); - Call call = service.recoverSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), snapshot, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return recoverSiteSlotDelegate(call.execute()); + Validator.validate(siteEnvelope); + Response result = service.createOrUpdateSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPutOrPatchResult(result, new TypeToken() { }.getType()); } /** - * Recovers a deleted web app. + * Creates a new web app or modifies an existing web app. * - * @param resourceGroupName Name of resource group - * @param name Name of web app + * @param resourceGroupName Name of the resource group + * @param name Name of the web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param snapshot Snapshot data used for web app recovery. Snapshot information can be obtained by call GetDeletedSites API. + * @param siteEnvelope Details of web app if it exists already + * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is + only used for app creation + * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. + * @param forceDnsRegistration If true, web app hostname is force registered with DNS + * @param ttlInSeconds Time to live in seconds for web app's default domain name * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null - * @return the {@link Call} object + * @return the {@link ServiceCall} object */ - public ServiceCall recoverSiteSlotAsync(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntity snapshot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } if (resourceGroupName == null) { serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - return null; } if (name == null) { serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); - return null; } if (slot == null) { serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); - return null; } - if (snapshot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - return null; + if (siteEnvelope == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); - return null; } - Validator.validate(snapshot, serviceCallback); - Call call = service.recoverSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), snapshot, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteEnvelope, serviceCallback); + Call call = service.createOrUpdateSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } @Override public void onResponse(Call call, Response response) { - try { - serviceCallback.success(recoverSiteSlotDelegate(response)); - } catch (CloudException | IOException exception) { - serviceCallback.failure(exception); - } + client.getAzureClient().getPutOrPatchResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); } }); return serviceCall; } - private ServiceResponse recoverSiteSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** - * Returns Snapshots to the user based on their SKU. + * Creates a new web app or modifies an existing web app. * - * @param name Website Name - * @param resourceGroupName the String value - * @param subscriptionName Azure subscription - * @param webspaceName Webspace + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteEnvelope Details of web app if it exists already * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Site object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteSnapshotsOnSku(String name, String resourceGroupName, String subscriptionName, String webspaceName) throws CloudException, IOException, IllegalArgumentException { - if (name == null) { - throw new IllegalArgumentException("Parameter name is required and cannot be null."); - } + public ServiceResponse beginCreateOrUpdateSiteSlot(String resourceGroupName, String name, String slot, Site siteEnvelope) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } - if (this.client.getSubscriptionId() == null) { + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (siteEnvelope == null) { + throw new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(siteEnvelope); + String skipDnsRegistration = null; + String skipCustomDomainVerification = null; + String forceDnsRegistration = null; + String ttlInSeconds = null; + Call call = service.beginCreateOrUpdateSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginCreateOrUpdateSiteSlotDelegate(call.execute()); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteEnvelope Details of web app if it exists already + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginCreateOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, Site siteEnvelope, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (siteEnvelope == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(siteEnvelope, serviceCallback); + final String skipDnsRegistration = null; + final String skipCustomDomainVerification = null; + final String forceDnsRegistration = null; + final String ttlInSeconds = null; + Call call = service.beginCreateOrUpdateSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginCreateOrUpdateSiteSlotDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteEnvelope Details of web app if it exists already + * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is + only used for app creation + * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. + * @param forceDnsRegistration If true, web app hostname is force registered with DNS + * @param ttlInSeconds Time to live in seconds for web app's default domain name + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Site object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse beginCreateOrUpdateSiteSlot(String resourceGroupName, String name, String slot, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (siteEnvelope == null) { + throw new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(siteEnvelope); + Call call = service.beginCreateOrUpdateSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginCreateOrUpdateSiteSlotDelegate(call.execute()); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteEnvelope Details of web app if it exists already + * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is + only used for app creation + * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. + * @param forceDnsRegistration If true, web app hostname is force registered with DNS + * @param ttlInSeconds Time to live in seconds for web app's default domain name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginCreateOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, Site siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (siteEnvelope == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(siteEnvelope, serviceCallback); + Call call = service.beginCreateOrUpdateSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginCreateOrUpdateSiteSlotDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse beginCreateOrUpdateSiteSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse deleteSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String deleteMetrics = null; + String deleteEmptyServerFarm = null; + String skipDnsRegistration = null; + String deleteAllSlots = null; + Call call = service.deleteSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteSiteSlotDelegate(call.execute()); + } + + /** + * Deletes a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall deleteSiteSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String deleteMetrics = null; + final String deleteEmptyServerFarm = null; + final String skipDnsRegistration = null; + final String deleteAllSlots = null; + Call call = service.deleteSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(deleteSiteSlotDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Deletes a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param deleteMetrics If true, web app metrics are also deleted + * @param deleteEmptyServerFarm If true and App Service Plan is empty after web app deletion, App Service Plan is also deleted + * @param skipDnsRegistration If true, DNS registration is skipped + * @param deleteAllSlots If true, all slots associated with web app are also deleted + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse deleteSiteSlot(String resourceGroupName, String name, String slot, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.deleteSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteSiteSlotDelegate(call.execute()); + } + + /** + * Deletes a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param deleteMetrics If true, web app metrics are also deleted + * @param deleteEmptyServerFarm If true and App Service Plan is empty after web app deletion, App Service Plan is also deleted + * @param skipDnsRegistration If true, DNS registration is skipped + * @param deleteAllSlots If true, all slots associated with web app are also deleted + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall deleteSiteSlotAsync(String resourceGroupName, String name, String slot, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.deleteSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(deleteSiteSlotDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse deleteSiteSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the SiteCloneability object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse isSiteCloneable(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.isSiteCloneable(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return isSiteCloneableDelegate(call.execute()); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall isSiteCloneableAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.isSiteCloneable(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(isSiteCloneableDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse isSiteCloneableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the SiteCloneability object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse isSiteCloneableSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.isSiteCloneableSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return isSiteCloneableSlotDelegate(call.execute()); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall isSiteCloneableSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.isSiteCloneableSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(isSiteCloneableSlotDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse isSiteCloneableSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Recovers a deleted web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param snapshot Snapshot data used for web app recovery. Snapshot information can be obtained by call GetDeletedSites API. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse recoverSite(String resourceGroupName, String name, CsmSiteRecoveryEntity snapshot) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (snapshot == null) { + throw new IllegalArgumentException("Parameter snapshot is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(snapshot); + Call call = service.recoverSite(resourceGroupName, name, this.client.getSubscriptionId(), snapshot, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return recoverSiteDelegate(call.execute()); + } + + /** + * Recovers a deleted web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param snapshot Snapshot data used for web app recovery. Snapshot information can be obtained by call GetDeletedSites API. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall recoverSiteAsync(String resourceGroupName, String name, CsmSiteRecoveryEntity snapshot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (snapshot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(snapshot, serviceCallback); + Call call = service.recoverSite(resourceGroupName, name, this.client.getSubscriptionId(), snapshot, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(recoverSiteDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse recoverSiteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Recovers a deleted web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param snapshot Snapshot data used for web app recovery. Snapshot information can be obtained by call GetDeletedSites API. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse recoverSiteSlot(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntity snapshot) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (snapshot == null) { + throw new IllegalArgumentException("Parameter snapshot is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(snapshot); + Call call = service.recoverSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), snapshot, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return recoverSiteSlotDelegate(call.execute()); + } + + /** + * Recovers a deleted web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param snapshot Snapshot data used for web app recovery. Snapshot information can be obtained by call GetDeletedSites API. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall recoverSiteSlotAsync(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntity snapshot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (snapshot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(snapshot, serviceCallback); + Call call = service.recoverSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), snapshot, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(recoverSiteSlotDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse recoverSiteSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns Snapshots to the user based on their SKU. + * + * @param name Website Name + * @param resourceGroupName the String value + * @param subscriptionName Azure subscription + * @param webspaceName Webspace + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getSiteSnapshotsOnSku(String name, String resourceGroupName, String subscriptionName, String webspaceName) throws CloudException, IOException, IllegalArgumentException { + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (subscriptionName == null) { + throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); + } + if (webspaceName == null) { + throw new IllegalArgumentException("Parameter webspaceName is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.getSiteSnapshotsOnSku(name, resourceGroupName, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteSnapshotsOnSkuDelegate(call.execute()); + } + + /** + * Returns Snapshots to the user based on their SKU. + * + * @param name Website Name + * @param resourceGroupName the String value + * @param subscriptionName Azure subscription + * @param webspaceName Webspace + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getSiteSnapshotsOnSkuAsync(String name, String resourceGroupName, String subscriptionName, String webspaceName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (subscriptionName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + return null; + } + if (webspaceName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter webspaceName is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.getSiteSnapshotsOnSku(name, resourceGroupName, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getSiteSnapshotsOnSkuDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getSiteSnapshotsOnSkuDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns Snapshots to the user based on their SKU. + * + * @param name Website Name + * @param resourceGroupName the String value + * @param slot the String value + * @param subscriptionName Azure subscription + * @param webspaceName Webspace + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getSiteSnapshotsOnSkuSlot(String name, String resourceGroupName, String slot, String subscriptionName, String webspaceName) throws CloudException, IOException, IllegalArgumentException { + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (subscriptionName == null) { + throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); + } + if (webspaceName == null) { + throw new IllegalArgumentException("Parameter webspaceName is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.getSiteSnapshotsOnSkuSlot(name, resourceGroupName, slot, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteSnapshotsOnSkuSlotDelegate(call.execute()); + } + + /** + * Returns Snapshots to the user based on their SKU. + * + * @param name Website Name + * @param resourceGroupName the String value + * @param slot the String value + * @param subscriptionName Azure subscription + * @param webspaceName Webspace + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getSiteSnapshotsOnSkuSlotAsync(String name, String resourceGroupName, String slot, String subscriptionName, String webspaceName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (subscriptionName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + return null; + } + if (webspaceName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter webspaceName is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.getSiteSnapshotsOnSkuSlot(name, resourceGroupName, slot, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getSiteSnapshotsOnSkuSlotDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getSiteSnapshotsOnSkuSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns all Snapshots to the user. + * + * @param name Website Name + * @param resourceGroupName the String value + * @param subscriptionName Azure subscription + * @param webspaceName Webspace + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getSiteSnapshots(String name, String resourceGroupName, String subscriptionName, String webspaceName) throws CloudException, IOException, IllegalArgumentException { + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (subscriptionName == null) { + throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); + } + if (webspaceName == null) { + throw new IllegalArgumentException("Parameter webspaceName is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.getSiteSnapshots(name, resourceGroupName, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteSnapshotsDelegate(call.execute()); + } + + /** + * Returns all Snapshots to the user. + * + * @param name Website Name + * @param resourceGroupName the String value + * @param subscriptionName Azure subscription + * @param webspaceName Webspace + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getSiteSnapshotsAsync(String name, String resourceGroupName, String subscriptionName, String webspaceName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (subscriptionName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + return null; + } + if (webspaceName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter webspaceName is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.getSiteSnapshots(name, resourceGroupName, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getSiteSnapshotsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getSiteSnapshotsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns all Snapshots to the user. + * + * @param name Website Name + * @param resourceGroupName the String value + * @param slot the String value + * @param subscriptionName Azure subscription + * @param webspaceName Webspace + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getSiteSnapshotsSlot(String name, String resourceGroupName, String slot, String subscriptionName, String webspaceName) throws CloudException, IOException, IllegalArgumentException { + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (subscriptionName == null) { + throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); + } + if (webspaceName == null) { + throw new IllegalArgumentException("Parameter webspaceName is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.getSiteSnapshotsSlot(name, resourceGroupName, slot, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteSnapshotsSlotDelegate(call.execute()); + } + + /** + * Returns all Snapshots to the user. + * + * @param name Website Name + * @param resourceGroupName the String value + * @param slot the String value + * @param subscriptionName Azure subscription + * @param webspaceName Webspace + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getSiteSnapshotsSlotAsync(String name, String resourceGroupName, String slot, String subscriptionName, String webspaceName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (subscriptionName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + return null; + } + if (webspaceName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter webspaceName is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.getSiteSnapshotsSlot(name, resourceGroupName, slot, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getSiteSnapshotsSlotDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getSiteSnapshotsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets deleted web apps in subscription. + * + * @param resourceGroupName Name of resource group + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DeletedSiteCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getDeletedSites(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + String propertiesToInclude = null; + String includeSiteTypes = null; + Call call = service.getDeletedSites(resourceGroupName, this.client.getSubscriptionId(), propertiesToInclude, includeSiteTypes, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getDeletedSitesDelegate(call.execute()); + } + + /** + * Gets deleted web apps in subscription. + * + * @param resourceGroupName Name of resource group + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getDeletedSitesAsync(String resourceGroupName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final String propertiesToInclude = null; + final String includeSiteTypes = null; + Call call = service.getDeletedSites(resourceGroupName, this.client.getSubscriptionId(), propertiesToInclude, includeSiteTypes, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDeletedSitesDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Gets deleted web apps in subscription. + * + * @param resourceGroupName Name of resource group + * @param propertiesToInclude Additional web app properties included in the response + * @param includeSiteTypes Types of apps included in the response + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DeletedSiteCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getDeletedSites(String resourceGroupName, String propertiesToInclude, String includeSiteTypes) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.getDeletedSites(resourceGroupName, this.client.getSubscriptionId(), propertiesToInclude, includeSiteTypes, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getDeletedSitesDelegate(call.execute()); + } + + /** + * Gets deleted web apps in subscription. + * + * @param resourceGroupName Name of resource group + * @param propertiesToInclude Additional web app properties included in the response + * @param includeSiteTypes Types of apps included in the response + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getDeletedSitesAsync(String resourceGroupName, String propertiesToInclude, String includeSiteTypes, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.getDeletedSites(resourceGroupName, this.client.getSubscriptionId(), propertiesToInclude, includeSiteTypes, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDeletedSitesDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getDeletedSitesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List deployments. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DeploymentCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getDeployments(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (subscriptionName == null) { - throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.getDeployments(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getDeploymentsDelegate(call.execute()); + } + + /** + * List deployments. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getDeploymentsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.getDeployments(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDeploymentsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getDeploymentsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List deployments. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DeploymentCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getDeploymentsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (webspaceName == null) { - throw new IllegalArgumentException("Parameter webspaceName is required and cannot be null."); + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteSnapshotsOnSku(name, resourceGroupName, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteSnapshotsOnSkuDelegate(call.execute()); + Call call = service.getDeploymentsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getDeploymentsSlotDelegate(call.execute()); } /** - * Returns Snapshots to the user based on their SKU. + * List deployments. * - * @param name Website Name - * @param resourceGroupName the String value - * @param subscriptionName Azure subscription - * @param webspaceName Webspace + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteSnapshotsOnSkuAsync(String name, String resourceGroupName, String subscriptionName, String webspaceName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getDeploymentsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } if (name == null) { serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.getDeploymentsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDeploymentsSlotDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getDeploymentsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List deployments. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param instanceId Id of web app instance + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DeploymentCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getInstanceDeployments(String resourceGroupName, String name, String instanceId) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.getInstanceDeployments(resourceGroupName, name, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getInstanceDeploymentsDelegate(call.execute()); + } + + /** + * List deployments. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param instanceId Id of web app instance + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getInstanceDeploymentsAsync(String resourceGroupName, String name, String instanceId, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } if (resourceGroupName == null) { serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); return null; } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (instanceId == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (subscriptionName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - if (webspaceName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter webspaceName is required and cannot be null.")); + Call call = service.getInstanceDeployments(resourceGroupName, name, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getInstanceDeploymentsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getInstanceDeploymentsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List deployments. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId Id of web app instance + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DeploymentCollection object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getInstanceDeploymentsSlot(String resourceGroupName, String name, String slot, String instanceId) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.getInstanceDeploymentsSlot(resourceGroupName, name, slot, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getInstanceDeploymentsSlotDelegate(call.execute()); + } + + /** + * List deployments. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId Id of web app instance + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getInstanceDeploymentsSlotAsync(String resourceGroupName, String name, String slot, String instanceId, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } + if (instanceId == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteSnapshotsOnSku(name, resourceGroupName, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getInstanceDeploymentsSlot(resourceGroupName, name, slot, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteSnapshotsOnSkuDelegate(response)); + serviceCallback.success(getInstanceDeploymentsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -4145,32 +5768,34 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteSnapshotsOnSkuDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getInstanceDeploymentsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Returns Snapshots to the user based on their SKU. + * Get the deployment. * - * @param name Website Name - * @param resourceGroupName the String value - * @param slot the String value - * @param subscriptionName Azure subscription - * @param webspaceName Webspace + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Deployment object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteSnapshotsOnSkuSlot(String name, String resourceGroupName, String slot, String subscriptionName, String webspaceName) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getDeploymentSlot(String resourceGroupName, String name, String id, String slot) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + if (id == null) { + throw new IllegalArgumentException("Parameter id is required and cannot be null."); } if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); @@ -4178,41 +5803,38 @@ public ServiceResponse getSiteSnapshotsOnSkuSlot(String name, String res if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (subscriptionName == null) { - throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); - } - if (webspaceName == null) { - throw new IllegalArgumentException("Parameter webspaceName is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteSnapshotsOnSkuSlot(name, resourceGroupName, slot, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteSnapshotsOnSkuSlotDelegate(call.execute()); + Call call = service.getDeploymentSlot(resourceGroupName, name, id, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getDeploymentSlotDelegate(call.execute()); } /** - * Returns Snapshots to the user based on their SKU. + * Get the deployment. * - * @param name Website Name - * @param resourceGroupName the String value - * @param slot the String value - * @param subscriptionName Azure subscription - * @param webspaceName Webspace + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteSnapshotsOnSkuSlotAsync(String name, String resourceGroupName, String slot, String subscriptionName, String webspaceName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } if (name == null) { serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (resourceGroupName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + if (id == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); return null; } if (slot == null) { @@ -4223,25 +5845,17 @@ public ServiceCall getSiteSnapshotsOnSkuSlotAsync(String name, String resourceGr serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (subscriptionName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); - return null; - } - if (webspaceName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter webspaceName is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteSnapshotsOnSkuSlot(name, resourceGroupName, slot, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getDeploymentSlot(resourceGroupName, name, id, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteSnapshotsOnSkuSlotDelegate(response)); + serviceCallback.success(getDeploymentSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -4250,94 +5864,105 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteSnapshotsOnSkuSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getDeploymentSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Returns all Snapshots to the user. + * Create a deployment. * - * @param name Website Name - * @param resourceGroupName the String value - * @param subscriptionName Azure subscription - * @param webspaceName Webspace + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param deployment Details of deployment * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Deployment object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteSnapshots(String name, String resourceGroupName, String subscriptionName, String webspaceName) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse createDeploymentSlot(String resourceGroupName, String name, String id, String slot, Deployment deployment) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + if (id == null) { + throw new IllegalArgumentException("Parameter id is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (subscriptionName == null) { - throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); - } - if (webspaceName == null) { - throw new IllegalArgumentException("Parameter webspaceName is required and cannot be null."); + if (deployment == null) { + throw new IllegalArgumentException("Parameter deployment is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteSnapshots(name, resourceGroupName, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteSnapshotsDelegate(call.execute()); + Validator.validate(deployment); + Call call = service.createDeploymentSlot(resourceGroupName, name, id, slot, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return createDeploymentSlotDelegate(call.execute()); } /** - * Returns all Snapshots to the user. + * Create a deployment. * - * @param name Website Name - * @param resourceGroupName the String value - * @param subscriptionName Azure subscription - * @param webspaceName Webspace + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param deployment Details of deployment * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteSnapshotsAsync(String name, String resourceGroupName, String subscriptionName, String webspaceName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, Deployment deployment, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } if (name == null) { serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (resourceGroupName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + if (id == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); return null; } - if (this.client.getSubscriptionId() == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } - if (subscriptionName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (webspaceName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter webspaceName is required and cannot be null.")); + if (deployment == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteSnapshots(name, resourceGroupName, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(deployment, serviceCallback); + Call call = service.createDeploymentSlot(resourceGroupName, name, id, slot, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteSnapshotsDelegate(response)); + serviceCallback.success(createDeploymentSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -4346,32 +5971,34 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteSnapshotsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse createDeploymentSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Returns all Snapshots to the user. + * Delete the deployment. * - * @param name Website Name - * @param resourceGroupName the String value - * @param slot the String value - * @param subscriptionName Azure subscription - * @param webspaceName Webspace + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteSnapshotsSlot(String name, String resourceGroupName, String slot, String subscriptionName, String webspaceName) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse deleteDeploymentSlot(String resourceGroupName, String name, String id, String slot) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + if (id == null) { + throw new IllegalArgumentException("Parameter id is required and cannot be null."); } if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); @@ -4379,41 +6006,38 @@ public ServiceResponse getSiteSnapshotsSlot(String name, String resource if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (subscriptionName == null) { - throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); - } - if (webspaceName == null) { - throw new IllegalArgumentException("Parameter webspaceName is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteSnapshotsSlot(name, resourceGroupName, slot, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteSnapshotsSlotDelegate(call.execute()); + Call call = service.deleteDeploymentSlot(resourceGroupName, name, id, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteDeploymentSlotDelegate(call.execute()); } /** - * Returns all Snapshots to the user. + * Delete the deployment. * - * @param name Website Name - * @param resourceGroupName the String value - * @param slot the String value - * @param subscriptionName Azure subscription - * @param webspaceName Webspace + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteSnapshotsSlotAsync(String name, String resourceGroupName, String slot, String subscriptionName, String webspaceName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall deleteDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } if (name == null) { serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (resourceGroupName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + if (id == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); return null; } if (slot == null) { @@ -4424,25 +6048,17 @@ public ServiceCall getSiteSnapshotsSlotAsync(String name, String resourceGroupNa serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (subscriptionName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); - return null; - } - if (webspaceName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter webspaceName is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteSnapshotsSlot(name, resourceGroupName, slot, this.client.getSubscriptionId(), subscriptionName, webspaceName, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.deleteDeploymentSlot(resourceGroupName, name, id, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteSnapshotsSlotDelegate(response)); + serviceCallback.success(deleteDeploymentSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -4451,7 +6067,7 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteSnapshotsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse deleteDeploymentSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) @@ -4459,46 +6075,60 @@ private ServiceResponse getSiteSnapshotsSlotDelegate(Response getDeletedSites(String resourceGroupName, String propertiesToInclude, String includeSiteTypes) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getDeployment(String resourceGroupName, String name, String id) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (id == null) { + throw new IllegalArgumentException("Parameter id is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getDeletedSites(resourceGroupName, this.client.getSubscriptionId(), propertiesToInclude, includeSiteTypes, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getDeletedSitesDelegate(call.execute()); + Call call = service.getDeployment(resourceGroupName, name, id, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getDeploymentDelegate(call.execute()); } /** - * Gets deleted web apps in subscription. + * Get the deployment. * * @param resourceGroupName Name of resource group - * @param propertiesToInclude Additional web app properties included in the response - * @param includeSiteTypes Types of apps included in the response + * @param name Name of web app + * @param id Id of the deployment * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getDeletedSitesAsync(String resourceGroupName, String propertiesToInclude, String includeSiteTypes, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getDeploymentAsync(String resourceGroupName, String name, String id, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } - if (resourceGroupName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (id == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { @@ -4509,13 +6139,13 @@ public ServiceCall getDeletedSitesAsync(String resourceGroupName, String propert serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getDeletedSites(resourceGroupName, this.client.getSubscriptionId(), propertiesToInclude, includeSiteTypes, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getDeployment(resourceGroupName, name, id, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getDeletedSitesDelegate(response)); + serviceCallback.success(getDeploymentDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -4524,50 +6154,61 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getDeletedSitesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getDeploymentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * List deployments. + * Create a deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param id Id of the deployment + * @param deployment Details of deployment * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DeploymentCollection object wrapped in {@link ServiceResponse} if successful. + * @return the Deployment object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getDeployments(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse createDeployment(String resourceGroupName, String name, String id, Deployment deployment) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (id == null) { + throw new IllegalArgumentException("Parameter id is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (deployment == null) { + throw new IllegalArgumentException("Parameter deployment is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getDeployments(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getDeploymentsDelegate(call.execute()); + Validator.validate(deployment); + Call call = service.createDeployment(resourceGroupName, name, id, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return createDeploymentDelegate(call.execute()); } /** - * List deployments. + * Create a deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param id Id of the deployment + * @param deployment Details of deployment * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getDeploymentsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createDeploymentAsync(String resourceGroupName, String name, String id, Deployment deployment, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -4579,21 +6220,30 @@ public ServiceCall getDeploymentsAsync(String resourceGroupName, String name, fi serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (id == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (deployment == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getDeployments(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(deployment, serviceCallback); + Call call = service.createDeployment(resourceGroupName, name, id, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getDeploymentsDelegate(response)); + serviceCallback.success(createDeploymentDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -4602,33 +6252,33 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getDeploymentsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse createDeploymentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * List deployments. + * Delete the deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. + * @param id Id of the deployment * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DeploymentCollection object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getDeploymentsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse deleteDeployment(String resourceGroupName, String name, String id) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + if (id == null) { + throw new IllegalArgumentException("Parameter id is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); @@ -4636,21 +6286,21 @@ public ServiceResponse getDeploymentsSlot(String resourceG if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getDeploymentsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getDeploymentsSlotDelegate(call.execute()); + Call call = service.deleteDeployment(resourceGroupName, name, id, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteDeploymentDelegate(call.execute()); } /** - * List deployments. + * Delete the deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. + * @param id Id of the deployment * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getDeploymentsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall deleteDeploymentAsync(String resourceGroupName, String name, String id, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -4662,8 +6312,8 @@ public ServiceCall getDeploymentsSlotAsync(String resourceGroupName, String name serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + if (id == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { @@ -4674,13 +6324,13 @@ public ServiceCall getDeploymentsSlotAsync(String resourceGroupName, String name serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getDeploymentsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.deleteDeployment(resourceGroupName, name, id, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getDeploymentsSlotDelegate(response)); + serviceCallback.success(deleteDeploymentDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -4689,31 +6339,35 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getDeploymentsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse deleteDeploymentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * List deployments. + * Get the deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param id Id of the deployment * @param instanceId Id of web app instance * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DeploymentCollection object wrapped in {@link ServiceResponse} if successful. + * @return the Deployment object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getInstanceDeployments(String resourceGroupName, String name, String instanceId) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getInstanceDeployment(String resourceGroupName, String name, String id, String instanceId) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (id == null) { + throw new IllegalArgumentException("Parameter id is required and cannot be null."); + } if (instanceId == null) { throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); } @@ -4723,21 +6377,22 @@ public ServiceResponse getInstanceDeployments(String resou if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getInstanceDeployments(resourceGroupName, name, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getInstanceDeploymentsDelegate(call.execute()); + Call call = service.getInstanceDeployment(resourceGroupName, name, id, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getInstanceDeploymentDelegate(call.execute()); } /** - * List deployments. + * Get the deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param id Id of the deployment * @param instanceId Id of web app instance * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getInstanceDeploymentsAsync(String resourceGroupName, String name, String instanceId, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -4749,6 +6404,10 @@ public ServiceCall getInstanceDeploymentsAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (id == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); + return null; + } if (instanceId == null) { serviceCallback.failure(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); return null; @@ -4761,13 +6420,13 @@ public ServiceCall getInstanceDeploymentsAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getInstanceDeployments(resourceGroupName, name, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getInstanceDeployment(resourceGroupName, name, id, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getInstanceDeploymentsDelegate(response)); + serviceCallback.success(getInstanceDeploymentDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -4776,34 +6435,35 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getInstanceDeploymentsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getInstanceDeploymentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * List deployments. + * Create a deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. + * @param id Id of the deployment * @param instanceId Id of web app instance + * @param deployment Details of deployment * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DeploymentCollection object wrapped in {@link ServiceResponse} if successful. + * @return the Deployment object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getInstanceDeploymentsSlot(String resourceGroupName, String name, String slot, String instanceId) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse createInstanceDeployment(String resourceGroupName, String name, String id, String instanceId, Deployment deployment) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + if (id == null) { + throw new IllegalArgumentException("Parameter id is required and cannot be null."); } if (instanceId == null) { throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); @@ -4811,25 +6471,30 @@ public ServiceResponse getInstanceDeploymentsSlot(String r if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (deployment == null) { + throw new IllegalArgumentException("Parameter deployment is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getInstanceDeploymentsSlot(resourceGroupName, name, slot, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getInstanceDeploymentsSlotDelegate(call.execute()); + Validator.validate(deployment); + Call call = service.createInstanceDeployment(resourceGroupName, name, id, instanceId, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return createInstanceDeploymentDelegate(call.execute()); } /** - * List deployments. + * Create a deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. + * @param id Id of the deployment * @param instanceId Id of web app instance + * @param deployment Details of deployment * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getInstanceDeploymentsSlotAsync(String resourceGroupName, String name, String slot, String instanceId, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId, Deployment deployment, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -4841,8 +6506,8 @@ public ServiceCall getInstanceDeploymentsSlotAsync(String resourceGroupName, Str serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + if (id == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); return null; } if (instanceId == null) { @@ -4853,17 +6518,22 @@ public ServiceCall getInstanceDeploymentsSlotAsync(String resourceGroupName, Str serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (deployment == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getInstanceDeploymentsSlot(resourceGroupName, name, slot, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(deployment, serviceCallback); + Call call = service.createInstanceDeployment(resourceGroupName, name, id, instanceId, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getInstanceDeploymentsSlotDelegate(response)); + serviceCallback.success(createInstanceDeploymentDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -4872,26 +6542,26 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getInstanceDeploymentsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse createInstanceDeploymentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Get the deployment. + * Delete the deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param id Id of the deployment - * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId Id of web app instance * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Deployment object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getDeploymentSlot(String resourceGroupName, String name, String id, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse deleteInstanceDeployment(String resourceGroupName, String name, String id, String instanceId) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4901,8 +6571,8 @@ public ServiceResponse getDeploymentSlot(String resourceGroupName, S if (id == null) { throw new IllegalArgumentException("Parameter id is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); @@ -4910,22 +6580,22 @@ public ServiceResponse getDeploymentSlot(String resourceGroupName, S if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getDeploymentSlot(resourceGroupName, name, id, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getDeploymentSlotDelegate(call.execute()); + Call call = service.deleteInstanceDeployment(resourceGroupName, name, id, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteInstanceDeploymentDelegate(call.execute()); } /** - * Get the deployment. + * Delete the deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param id Id of the deployment - * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId Id of web app instance * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall deleteInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -4941,8 +6611,8 @@ public ServiceCall getDeploymentSlotAsync(String resourceGroupName, String name, serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + if (instanceId == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { @@ -4953,13 +6623,13 @@ public ServiceCall getDeploymentSlotAsync(String resourceGroupName, String name, serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getDeploymentSlot(resourceGroupName, name, id, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.deleteInstanceDeployment(resourceGroupName, name, id, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getDeploymentSlotDelegate(response)); + serviceCallback.success(deleteInstanceDeploymentDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -4968,27 +6638,27 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getDeploymentSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse deleteInstanceDeploymentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Create a deployment. + * Get the deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param id Id of the deployment * @param slot Name of web app slot. If not specified then will default to production slot. - * @param deployment Details of deployment + * @param instanceId Id of web app instance * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @return the Deployment object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse createDeploymentSlot(String resourceGroupName, String name, String id, String slot, Deployment deployment) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getInstanceDeploymentSlot(String resourceGroupName, String name, String id, String slot, String instanceId) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -5001,33 +6671,32 @@ public ServiceResponse createDeploymentSlot(String resourceGroupName if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (deployment == null) { - throw new IllegalArgumentException("Parameter deployment is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(deployment); - Call call = service.createDeploymentSlot(resourceGroupName, name, id, slot, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return createDeploymentSlotDelegate(call.execute()); + Call call = service.getInstanceDeploymentSlot(resourceGroupName, name, id, slot, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getInstanceDeploymentSlotDelegate(call.execute()); } /** - * Create a deployment. + * Get the deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param id Id of the deployment * @param slot Name of web app slot. If not specified then will default to production slot. - * @param deployment Details of deployment + * @param instanceId Id of web app instance * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall createDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, Deployment deployment, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -5047,26 +6716,25 @@ public ServiceCall createDeploymentSlotAsync(String resourceGroupName, String na serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } - if (this.client.getSubscriptionId() == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (instanceId == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); return null; } - if (deployment == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; - } - Validator.validate(deployment, serviceCallback); - Call call = service.createDeploymentSlot(resourceGroupName, name, id, slot, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); + } + Call call = service.getInstanceDeploymentSlot(resourceGroupName, name, id, slot, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(createDeploymentSlotDelegate(response)); + serviceCallback.success(getInstanceDeploymentSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -5075,7 +6743,7 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse createDeploymentSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse getInstanceDeploymentSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) @@ -5083,18 +6751,20 @@ private ServiceResponse createDeploymentSlotDelegate(Response deleteDeploymentSlot(String resourceGroupName, String name, String id, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse createInstanceDeploymentSlot(String resourceGroupName, String name, String id, String slot, String instanceId, Deployment deployment) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -5107,28 +6777,37 @@ public ServiceResponse deleteDeploymentSlot(String resourceGroupName, St if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (deployment == null) { + throw new IllegalArgumentException("Parameter deployment is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.deleteDeploymentSlot(resourceGroupName, name, id, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return deleteDeploymentSlotDelegate(call.execute()); + Validator.validate(deployment); + Call call = service.createInstanceDeploymentSlot(resourceGroupName, name, id, slot, instanceId, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return createInstanceDeploymentSlotDelegate(call.execute()); } /** - * Delete the deployment. + * Create a deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param id Id of the deployment * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId Id of web app instance + * @param deployment Details of deployment * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall deleteDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId, Deployment deployment, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -5148,21 +6827,30 @@ public ServiceCall deleteDeploymentSlotAsync(String resourceGroupName, String na serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } + if (instanceId == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (deployment == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.deleteDeploymentSlot(resourceGroupName, name, id, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(deployment, serviceCallback); + Call call = service.createInstanceDeploymentSlot(resourceGroupName, name, id, slot, instanceId, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(deleteDeploymentSlotDelegate(response)); + serviceCallback.success(createInstanceDeploymentSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -5171,25 +6859,27 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse deleteDeploymentSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse createInstanceDeploymentSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Get the deployment. + * Delete the deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId Id of web app instance * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Deployment object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getDeployment(String resourceGroupName, String name, String id) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse deleteInstanceDeploymentSlot(String resourceGroupName, String name, String id, String slot, String instanceId) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -5199,27 +6889,35 @@ public ServiceResponse getDeployment(String resourceGroupName, Strin if (id == null) { throw new IllegalArgumentException("Parameter id is required and cannot be null."); } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getDeployment(resourceGroupName, name, id, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getDeploymentDelegate(call.execute()); + Call call = service.deleteInstanceDeploymentSlot(resourceGroupName, name, id, slot, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteInstanceDeploymentSlotDelegate(call.execute()); } /** - * Get the deployment. + * Delete the deployment. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId Id of web app instance * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getDeploymentAsync(String resourceGroupName, String name, String id, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall deleteInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -5235,6 +6933,14 @@ public ServiceCall getDeploymentAsync(String resourceGroupName, String name, Str serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); return null; } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } + if (instanceId == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; @@ -5243,13 +6949,13 @@ public ServiceCall getDeploymentAsync(String resourceGroupName, String name, Str serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getDeployment(resourceGroupName, name, id, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.deleteInstanceDeploymentSlot(resourceGroupName, name, id, slot, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getDeploymentDelegate(response)); + serviceCallback.success(deleteInstanceDeploymentSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -5258,61 +6964,50 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getDeploymentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse deleteInstanceDeploymentSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Create a deployment. + * Gets all instance of a web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment - * @param deployment Details of deployment * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Deployment object wrapped in {@link ServiceResponse} if successful. + * @return the SiteInstanceCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse createDeployment(String resourceGroupName, String name, String id, Deployment deployment) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteInstanceIdentifiers(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (id == null) { - throw new IllegalArgumentException("Parameter id is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (deployment == null) { - throw new IllegalArgumentException("Parameter deployment is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(deployment); - Call call = service.createDeployment(resourceGroupName, name, id, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return createDeploymentDelegate(call.execute()); + Call call = service.getSiteInstanceIdentifiers(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteInstanceIdentifiersDelegate(call.execute()); } /** - * Create a deployment. + * Gets all instance of a web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment - * @param deployment Details of deployment * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall createDeploymentAsync(String resourceGroupName, String name, String id, Deployment deployment, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteInstanceIdentifiersAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -5324,30 +7019,21 @@ public ServiceCall createDeploymentAsync(String resourceGroupName, String name, serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (id == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (deployment == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(deployment, serviceCallback); - Call call = service.createDeployment(resourceGroupName, name, id, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteInstanceIdentifiers(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(createDeploymentDelegate(response)); + serviceCallback.success(getSiteInstanceIdentifiersDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -5356,33 +7042,33 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse createDeploymentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteInstanceIdentifiersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Delete the deployment. + * Gets all instance of a web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the SiteInstanceCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse deleteDeployment(String resourceGroupName, String name, String id) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteInstanceIdentifiersSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (id == null) { - throw new IllegalArgumentException("Parameter id is required and cannot be null."); + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); @@ -5390,21 +7076,21 @@ public ServiceResponse deleteDeployment(String resourceGroupName, String if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.deleteDeployment(resourceGroupName, name, id, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return deleteDeploymentDelegate(call.execute()); + Call call = service.getSiteInstanceIdentifiersSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteInstanceIdentifiersSlotDelegate(call.execute()); } /** - * Delete the deployment. + * Gets all instance of a web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall deleteDeploymentAsync(String resourceGroupName, String name, String id, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteInstanceIdentifiersSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -5416,8 +7102,8 @@ public ServiceCall deleteDeploymentAsync(String resourceGroupName, String name, serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (id == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { @@ -5428,13 +7114,13 @@ public ServiceCall deleteDeploymentAsync(String resourceGroupName, String name, serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.deleteDeployment(resourceGroupName, name, id, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteInstanceIdentifiersSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(deleteDeploymentDelegate(response)); + serviceCallback.success(getSiteInstanceIdentifiersSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -5443,37 +7129,33 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse deleteDeploymentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteInstanceIdentifiersSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Get the deployment. + * Get web app hostname bindings. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment - * @param instanceId Id of web app instance + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Deployment object wrapped in {@link ServiceResponse} if successful. + * @return the HostNameBindingCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getInstanceDeployment(String resourceGroupName, String name, String id, String instanceId) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteHostNameBindingsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (id == null) { - throw new IllegalArgumentException("Parameter id is required and cannot be null."); - } - if (instanceId == null) { - throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); @@ -5481,22 +7163,21 @@ public ServiceResponse getInstanceDeployment(String resourceGroupNam if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getInstanceDeployment(resourceGroupName, name, id, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getInstanceDeploymentDelegate(call.execute()); + Call call = service.getSiteHostNameBindingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteHostNameBindingsSlotDelegate(call.execute()); } /** - * Get the deployment. + * Get web app hostname bindings. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment - * @param instanceId Id of web app instance + * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteHostNameBindingsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -5508,12 +7189,8 @@ public ServiceCall getInstanceDeploymentAsync(String resourceGroupName, String n serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (id == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); - return null; - } - if (instanceId == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { @@ -5524,13 +7201,13 @@ public ServiceCall getInstanceDeploymentAsync(String resourceGroupName, String n serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getInstanceDeployment(resourceGroupName, name, id, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteHostNameBindingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getInstanceDeploymentDelegate(response)); + serviceCallback.success(getSiteHostNameBindingsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -5539,66 +7216,50 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getInstanceDeploymentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteHostNameBindingsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Create a deployment. + * Get web app hostname bindings. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment - * @param instanceId Id of web app instance - * @param deployment Details of deployment * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Deployment object wrapped in {@link ServiceResponse} if successful. + * @return the HostNameBindingCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse createInstanceDeployment(String resourceGroupName, String name, String id, String instanceId, Deployment deployment) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteHostNameBindings(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (id == null) { - throw new IllegalArgumentException("Parameter id is required and cannot be null."); - } - if (instanceId == null) { - throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (deployment == null) { - throw new IllegalArgumentException("Parameter deployment is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(deployment); - Call call = service.createInstanceDeployment(resourceGroupName, name, id, instanceId, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return createInstanceDeploymentDelegate(call.execute()); + Call call = service.getSiteHostNameBindings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteHostNameBindingsDelegate(call.execute()); } /** - * Create a deployment. + * Get web app hostname bindings. * * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param id Id of the deployment - * @param instanceId Id of web app instance - * @param deployment Details of deployment + * @param name Name of web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall createInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId, Deployment deployment, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteHostNameBindingsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -5610,34 +7271,21 @@ public ServiceCall createInstanceDeploymentAsync(String resourceGroupName, Strin serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (id == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); - return null; - } - if (instanceId == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (deployment == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(deployment, serviceCallback); - Call call = service.createInstanceDeployment(resourceGroupName, name, id, instanceId, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteHostNameBindings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(createInstanceDeploymentDelegate(response)); + serviceCallback.success(getSiteHostNameBindingsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -5646,37 +7294,33 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse createInstanceDeploymentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteHostNameBindingsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Delete the deployment. + * Get web app binding for a hostname. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment - * @param instanceId Id of web app instance + * @param hostName Name of host * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the HostNameBinding object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse deleteInstanceDeployment(String resourceGroupName, String name, String id, String instanceId) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteHostNameBinding(String resourceGroupName, String name, String hostName) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (id == null) { - throw new IllegalArgumentException("Parameter id is required and cannot be null."); - } - if (instanceId == null) { - throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + if (hostName == null) { + throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); @@ -5684,22 +7328,21 @@ public ServiceResponse deleteInstanceDeployment(String resourceGroupName if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.deleteInstanceDeployment(resourceGroupName, name, id, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return deleteInstanceDeploymentDelegate(call.execute()); + Call call = service.getSiteHostNameBinding(resourceGroupName, name, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteHostNameBindingDelegate(call.execute()); } /** - * Delete the deployment. + * Get web app binding for a hostname. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment - * @param instanceId Id of web app instance + * @param hostName Name of host * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall deleteInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -5711,12 +7354,8 @@ public ServiceCall deleteInstanceDeploymentAsync(String resourceGroupName, Strin serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (id == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); - return null; - } - if (instanceId == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + if (hostName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter hostName is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { @@ -5727,13 +7366,13 @@ public ServiceCall deleteInstanceDeploymentAsync(String resourceGroupName, Strin serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.deleteInstanceDeployment(resourceGroupName, name, id, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteHostNameBinding(resourceGroupName, name, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(deleteInstanceDeploymentDelegate(response)); + serviceCallback.success(getSiteHostNameBindingDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -5742,65 +7381,61 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse deleteInstanceDeploymentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteHostNameBindingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Get the deployment. + * Creates a web app hostname binding. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId Id of web app instance + * @param hostName Name of host + * @param hostNameBinding Host name binding information * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Deployment object wrapped in {@link ServiceResponse} if successful. + * @return the HostNameBinding object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getInstanceDeploymentSlot(String resourceGroupName, String name, String id, String slot, String instanceId) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse createOrUpdateSiteHostNameBinding(String resourceGroupName, String name, String hostName, HostNameBinding hostNameBinding) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (id == null) { - throw new IllegalArgumentException("Parameter id is required and cannot be null."); - } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } - if (instanceId == null) { - throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + if (hostName == null) { + throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (hostNameBinding == null) { + throw new IllegalArgumentException("Parameter hostNameBinding is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getInstanceDeploymentSlot(resourceGroupName, name, id, slot, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getInstanceDeploymentSlotDelegate(call.execute()); + Validator.validate(hostNameBinding); + Call call = service.createOrUpdateSiteHostNameBinding(resourceGroupName, name, hostName, this.client.getSubscriptionId(), hostNameBinding, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return createOrUpdateSiteHostNameBindingDelegate(call.execute()); } /** - * Get the deployment. + * Creates a web app hostname binding. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId Id of web app instance + * @param hostName Name of host + * @param hostNameBinding Host name binding information * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createOrUpdateSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName, HostNameBinding hostNameBinding, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -5812,33 +7447,30 @@ public ServiceCall getInstanceDeploymentSlotAsync(String resourceGroupName, Stri serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (id == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); - return null; - } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } - if (instanceId == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + if (hostName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter hostName is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (hostNameBinding == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter hostNameBinding is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getInstanceDeploymentSlot(resourceGroupName, name, id, slot, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(hostNameBinding, serviceCallback); + Call call = service.createOrUpdateSiteHostNameBinding(resourceGroupName, name, hostName, this.client.getSubscriptionId(), hostNameBinding, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getInstanceDeploymentSlotDelegate(response)); + serviceCallback.success(createOrUpdateSiteHostNameBindingDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -5847,71 +7479,55 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getInstanceDeploymentSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse createOrUpdateSiteHostNameBindingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Create a deployment. + * Deletes a host name binding. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId Id of web app instance - * @param deployment Details of deployment + * @param hostName Name of host * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Deployment object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse createInstanceDeploymentSlot(String resourceGroupName, String name, String id, String slot, String instanceId, Deployment deployment) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse deleteSiteHostNameBinding(String resourceGroupName, String name, String hostName) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (id == null) { - throw new IllegalArgumentException("Parameter id is required and cannot be null."); - } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } - if (instanceId == null) { - throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + if (hostName == null) { + throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (deployment == null) { - throw new IllegalArgumentException("Parameter deployment is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(deployment); - Call call = service.createInstanceDeploymentSlot(resourceGroupName, name, id, slot, instanceId, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return createInstanceDeploymentSlotDelegate(call.execute()); + Call call = service.deleteSiteHostNameBinding(resourceGroupName, name, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteSiteHostNameBindingDelegate(call.execute()); } /** - * Create a deployment. + * Deletes a host name binding. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId Id of web app instance - * @param deployment Details of deployment + * @param hostName Name of host * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall createInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId, Deployment deployment, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall deleteSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -5923,38 +7539,25 @@ public ServiceCall createInstanceDeploymentSlotAsync(String resourceGroupName, S serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (id == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); - return null; - } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } - if (instanceId == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + if (hostName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter hostName is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (deployment == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(deployment, serviceCallback); - Call call = service.createInstanceDeploymentSlot(resourceGroupName, name, id, slot, instanceId, this.client.getSubscriptionId(), deployment, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.deleteSiteHostNameBinding(resourceGroupName, name, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(createInstanceDeploymentSlotDelegate(response)); + serviceCallback.success(deleteSiteHostNameBindingDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -5963,41 +7566,37 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse createInstanceDeploymentSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse deleteSiteHostNameBindingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Delete the deployment. + * Get web app binding for a hostname. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId Id of web app instance + * @param hostName Name of host * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the HostNameBinding object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse deleteInstanceDeploymentSlot(String resourceGroupName, String name, String id, String slot, String instanceId) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteHostNameBindingSlot(String resourceGroupName, String name, String slot, String hostName) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (id == null) { - throw new IllegalArgumentException("Parameter id is required and cannot be null."); - } if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } - if (instanceId == null) { - throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + if (hostName == null) { + throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); @@ -6005,23 +7604,22 @@ public ServiceResponse deleteInstanceDeploymentSlot(String resourceGroup if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.deleteInstanceDeploymentSlot(resourceGroupName, name, id, slot, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return deleteInstanceDeploymentSlotDelegate(call.execute()); + Call call = service.getSiteHostNameBindingSlot(resourceGroupName, name, slot, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteHostNameBindingSlotDelegate(call.execute()); } /** - * Delete the deployment. + * Get web app binding for a hostname. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param id Id of the deployment * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId Id of web app instance + * @param hostName Name of host * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall deleteInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String slot, String hostName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -6033,16 +7631,12 @@ public ServiceCall deleteInstanceDeploymentSlotAsync(String resourceGroupName, S serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (id == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter id is required and cannot be null.")); - return null; - } if (slot == null) { serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } - if (instanceId == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + if (hostName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter hostName is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { @@ -6053,13 +7647,13 @@ public ServiceCall deleteInstanceDeploymentSlotAsync(String resourceGroupName, S serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.deleteInstanceDeploymentSlot(resourceGroupName, name, id, slot, instanceId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteHostNameBindingSlot(resourceGroupName, name, slot, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(deleteInstanceDeploymentSlotDelegate(response)); + serviceCallback.success(getSiteHostNameBindingSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -6068,50 +7662,66 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse deleteInstanceDeploymentSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteHostNameBindingSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets all instance of a web app. + * Creates a web app hostname binding. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param hostName Name of host + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param hostNameBinding Host name binding information * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteInstanceCollection object wrapped in {@link ServiceResponse} if successful. + * @return the HostNameBinding object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteInstanceIdentifiers(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse createOrUpdateSiteHostNameBindingSlot(String resourceGroupName, String name, String hostName, String slot, HostNameBinding hostNameBinding) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (hostName == null) { + throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (hostNameBinding == null) { + throw new IllegalArgumentException("Parameter hostNameBinding is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteInstanceIdentifiers(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteInstanceIdentifiersDelegate(call.execute()); + Validator.validate(hostNameBinding); + Call call = service.createOrUpdateSiteHostNameBindingSlot(resourceGroupName, name, hostName, slot, this.client.getSubscriptionId(), hostNameBinding, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return createOrUpdateSiteHostNameBindingSlotDelegate(call.execute()); } /** - * Gets all instance of a web app. + * Creates a web app hostname binding. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param hostName Name of host + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param hostNameBinding Host name binding information * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteInstanceIdentifiersAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createOrUpdateSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String hostName, String slot, HostNameBinding hostNameBinding, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -6123,21 +7733,34 @@ public ServiceCall getSiteInstanceIdentifiersAsync(String resourceGroupName, Str serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (hostName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter hostName is required and cannot be null.")); + return null; + } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (hostNameBinding == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter hostNameBinding is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteInstanceIdentifiers(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(hostNameBinding, serviceCallback); + Call call = service.createOrUpdateSiteHostNameBindingSlot(resourceGroupName, name, hostName, slot, this.client.getSubscriptionId(), hostNameBinding, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteInstanceIdentifiersDelegate(response)); + serviceCallback.success(createOrUpdateSiteHostNameBindingSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -6146,25 +7769,26 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteInstanceIdentifiersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse createOrUpdateSiteHostNameBindingSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets all instance of a web app. + * Deletes a host name binding. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. + * @param hostName Name of host * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteInstanceCollection object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteInstanceIdentifiersSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse deleteSiteHostNameBindingSlot(String resourceGroupName, String name, String slot, String hostName) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -6174,27 +7798,31 @@ public ServiceResponse getSiteInstanceIdentifiersSlot(St if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } + if (hostName == null) { + throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteInstanceIdentifiersSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteInstanceIdentifiersSlotDelegate(call.execute()); + Call call = service.deleteSiteHostNameBindingSlot(resourceGroupName, name, slot, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteSiteHostNameBindingSlotDelegate(call.execute()); } /** - * Gets all instance of a web app. + * Deletes a host name binding. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. + * @param hostName Name of host * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteInstanceIdentifiersSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall deleteSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String slot, String hostName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -6210,6 +7838,10 @@ public ServiceCall getSiteInstanceIdentifiersSlotAsync(String resourceGroupName, serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } + if (hostName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter hostName is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; @@ -6218,13 +7850,13 @@ public ServiceCall getSiteInstanceIdentifiersSlotAsync(String resourceGroupName, serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteInstanceIdentifiersSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.deleteSiteHostNameBindingSlot(resourceGroupName, name, slot, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteInstanceIdentifiersSlotDelegate(response)); + serviceCallback.success(deleteSiteHostNameBindingSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -6233,55 +7865,50 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteInstanceIdentifiersSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse deleteSiteHostNameBindingSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Get web app hostname bindings. + * Gets the configuration of the web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the HostNameBindingCollection object wrapped in {@link ServiceResponse} if successful. + * @return the SiteConfig object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteHostNameBindingsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteConfig(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteHostNameBindingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteHostNameBindingsSlotDelegate(call.execute()); + Call call = service.getSiteConfig(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteConfigDelegate(call.execute()); } /** - * Get web app hostname bindings. + * Gets the configuration of the web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteHostNameBindingsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteConfigAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -6293,10 +7920,6 @@ public ServiceCall getSiteHostNameBindingsSlotAsync(String resourceGroupName, St serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; @@ -6305,13 +7928,13 @@ public ServiceCall getSiteHostNameBindingsSlotAsync(String resourceGroupName, St serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteHostNameBindingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteConfig(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteHostNameBindingsSlotDelegate(response)); + serviceCallback.success(getSiteConfigDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -6320,24 +7943,25 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteHostNameBindingsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Get web app hostname bindings. + * Update the configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param siteConfig Request body that contains the configuraiton setting for the web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the HostNameBindingCollection object wrapped in {@link ServiceResponse} if successful. + * @return the SiteConfig object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteHostNameBindings(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse createOrUpdateSiteConfig(String resourceGroupName, String name, SiteConfig siteConfig) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -6347,23 +7971,28 @@ public ServiceResponse getSiteHostNameBindings(String if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (siteConfig == null) { + throw new IllegalArgumentException("Parameter siteConfig is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteHostNameBindings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteHostNameBindingsDelegate(call.execute()); + Validator.validate(siteConfig); + Call call = service.createOrUpdateSiteConfig(resourceGroupName, name, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return createOrUpdateSiteConfigDelegate(call.execute()); } /** - * Get web app hostname bindings. + * Update the configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param siteConfig Request body that contains the configuraiton setting for the web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteHostNameBindingsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createOrUpdateSiteConfigAsync(String resourceGroupName, String name, SiteConfig siteConfig, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -6379,17 +8008,22 @@ public ServiceCall getSiteHostNameBindingsAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (siteConfig == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteHostNameBindings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteConfig, serviceCallback); + Call call = service.createOrUpdateSiteConfig(resourceGroupName, name, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteHostNameBindingsDelegate(response)); + serviceCallback.success(createOrUpdateSiteConfigDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -6398,55 +8032,56 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteHostNameBindingsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse createOrUpdateSiteConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Get web app binding for a hostname. + * Update the configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param hostName Name of host + * @param siteConfig Request body that contains the configuraiton setting for the web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the HostNameBinding object wrapped in {@link ServiceResponse} if successful. + * @return the SiteConfig object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteHostNameBinding(String resourceGroupName, String name, String hostName) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteConfig(String resourceGroupName, String name, SiteConfig siteConfig) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (hostName == null) { - throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (siteConfig == null) { + throw new IllegalArgumentException("Parameter siteConfig is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteHostNameBinding(resourceGroupName, name, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteHostNameBindingDelegate(call.execute()); + Validator.validate(siteConfig); + Call call = service.updateSiteConfig(resourceGroupName, name, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteConfigDelegate(call.execute()); } /** - * Get web app binding for a hostname. + * Update the configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param hostName Name of host + * @param siteConfig Request body that contains the configuraiton setting for the web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteConfigAsync(String resourceGroupName, String name, SiteConfig siteConfig, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -6458,25 +8093,26 @@ public ServiceCall getSiteHostNameBindingAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (hostName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter hostName is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (siteConfig == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteHostNameBinding(resourceGroupName, name, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteConfig, serviceCallback); + Call call = service.updateSiteConfig(resourceGroupName, name, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteHostNameBindingDelegate(response)); + serviceCallback.success(updateSiteConfigDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -6485,61 +8121,55 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteHostNameBindingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Creates a web app hostname binding. + * Gets the configuration of the web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param hostName Name of host - * @param hostNameBinding Host name binding information + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the HostNameBinding object wrapped in {@link ServiceResponse} if successful. + * @return the SiteConfig object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse createOrUpdateSiteHostNameBinding(String resourceGroupName, String name, String hostName, HostNameBinding hostNameBinding) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteConfigSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (hostName == null) { - throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (hostNameBinding == null) { - throw new IllegalArgumentException("Parameter hostNameBinding is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(hostNameBinding); - Call call = service.createOrUpdateSiteHostNameBinding(resourceGroupName, name, hostName, this.client.getSubscriptionId(), hostNameBinding, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return createOrUpdateSiteHostNameBindingDelegate(call.execute()); + Call call = service.getSiteConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteConfigSlotDelegate(call.execute()); } /** - * Creates a web app hostname binding. + * Gets the configuration of the web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param hostName Name of host - * @param hostNameBinding Host name binding information + * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall createOrUpdateSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName, HostNameBinding hostNameBinding, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteConfigSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -6551,87 +8181,88 @@ public ServiceCall createOrUpdateSiteHostNameBindingAsync(String resourceGroupNa serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (hostName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter hostName is required and cannot be null.")); + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (hostNameBinding == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter hostNameBinding is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(hostNameBinding, serviceCallback); - Call call = service.createOrUpdateSiteHostNameBinding(resourceGroupName, name, hostName, this.client.getSubscriptionId(), hostNameBinding, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(createOrUpdateSiteHostNameBindingDelegate(response)); + serviceCallback.success(getSiteConfigSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } } }); return serviceCall; - } - - private ServiceResponse createOrUpdateSiteHostNameBindingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + } + + private ServiceResponse getSiteConfigSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Deletes a host name binding. + * Update the configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param hostName Name of host + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteConfig Request body that contains the configuraiton setting for the web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the SiteConfig object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse deleteSiteHostNameBinding(String resourceGroupName, String name, String hostName) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse createOrUpdateSiteConfigSlot(String resourceGroupName, String name, String slot, SiteConfig siteConfig) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (hostName == null) { - throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (siteConfig == null) { + throw new IllegalArgumentException("Parameter siteConfig is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.deleteSiteHostNameBinding(resourceGroupName, name, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return deleteSiteHostNameBindingDelegate(call.execute()); + Validator.validate(siteConfig); + Call call = service.createOrUpdateSiteConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return createOrUpdateSiteConfigSlotDelegate(call.execute()); } /** - * Deletes a host name binding. + * Update the configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param hostName Name of host + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteConfig Request body that contains the configuraiton setting for the web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall deleteSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createOrUpdateSiteConfigSlotAsync(String resourceGroupName, String name, String slot, SiteConfig siteConfig, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -6643,25 +8274,30 @@ public ServiceCall deleteSiteHostNameBindingAsync(String resourceGroupName, Stri serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (hostName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter hostName is required and cannot be null.")); + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (siteConfig == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.deleteSiteHostNameBinding(resourceGroupName, name, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteConfig, serviceCallback); + Call call = service.createOrUpdateSiteConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(deleteSiteHostNameBindingDelegate(response)); + serviceCallback.success(createOrUpdateSiteConfigSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -6670,26 +8306,26 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse deleteSiteHostNameBindingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse createOrUpdateSiteConfigSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Get web app binding for a hostname. + * Update the configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param hostName Name of host + * @param siteConfig Request body that contains the configuraiton setting for the web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the HostNameBinding object wrapped in {@link ServiceResponse} if successful. + * @return the SiteConfig object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteHostNameBindingSlot(String resourceGroupName, String name, String slot, String hostName) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteConfigSlot(String resourceGroupName, String name, String slot, SiteConfig siteConfig) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -6699,31 +8335,32 @@ public ServiceResponse getSiteHostNameBindingSlot(String resour if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } - if (hostName == null) { - throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (siteConfig == null) { + throw new IllegalArgumentException("Parameter siteConfig is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteHostNameBindingSlot(resourceGroupName, name, slot, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteHostNameBindingSlotDelegate(call.execute()); + Validator.validate(siteConfig); + Call call = service.updateSiteConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteConfigSlotDelegate(call.execute()); } /** - * Get web app binding for a hostname. + * Update the configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param hostName Name of host + * @param siteConfig Request body that contains the configuraiton setting for the web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String slot, String hostName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteConfigSlotAsync(String resourceGroupName, String name, String slot, SiteConfig siteConfig, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -6739,25 +8376,26 @@ public ServiceCall getSiteHostNameBindingSlotAsync(String resourceGroupName, Str serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } - if (hostName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter hostName is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (siteConfig == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteHostNameBindingSlot(resourceGroupName, name, slot, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteConfig, serviceCallback); + Call call = service.updateSiteConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteHostNameBindingSlotDelegate(response)); + serviceCallback.success(updateSiteConfigSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -6766,66 +8404,50 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteHostNameBindingSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteConfigSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Creates a web app hostname binding. + * Get the source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param hostName Name of host - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param hostNameBinding Host name binding information * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the HostNameBinding object wrapped in {@link ServiceResponse} if successful. + * @return the SiteSourceControl object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse createOrUpdateSiteHostNameBindingSlot(String resourceGroupName, String name, String hostName, String slot, HostNameBinding hostNameBinding) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteSourceControl(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (hostName == null) { - throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); - } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (hostNameBinding == null) { - throw new IllegalArgumentException("Parameter hostNameBinding is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(hostNameBinding); - Call call = service.createOrUpdateSiteHostNameBindingSlot(resourceGroupName, name, hostName, slot, this.client.getSubscriptionId(), hostNameBinding, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return createOrUpdateSiteHostNameBindingSlotDelegate(call.execute()); + Call call = service.getSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteSourceControlDelegate(call.execute()); } /** - * Creates a web app hostname binding. + * Get the source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param hostName Name of host - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param hostNameBinding Host name binding information * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall createOrUpdateSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String hostName, String slot, HostNameBinding hostNameBinding, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteSourceControlAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -6837,34 +8459,21 @@ public ServiceCall createOrUpdateSiteHostNameBindingSlotAsync(String resourceGro serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (hostName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter hostName is required and cannot be null.")); - return null; - } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (hostNameBinding == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter hostNameBinding is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(hostNameBinding, serviceCallback); - Call call = service.createOrUpdateSiteHostNameBindingSlot(resourceGroupName, name, hostName, slot, this.client.getSubscriptionId(), hostNameBinding, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(createOrUpdateSiteHostNameBindingSlotDelegate(response)); + serviceCallback.success(getSiteSourceControlDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -6873,60 +8482,56 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse createOrUpdateSiteHostNameBindingSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteSourceControlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Deletes a host name binding. + * Update the source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param hostName Name of host + * @param siteSourceControl Request body that contains the source control parameters * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the SiteSourceControl object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse deleteSiteHostNameBindingSlot(String resourceGroupName, String name, String slot, String hostName) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse createOrUpdateSiteSourceControl(String resourceGroupName, String name, SiteSourceControl siteSourceControl) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } - if (hostName == null) { - throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (siteSourceControl == null) { + throw new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.deleteSiteHostNameBindingSlot(resourceGroupName, name, slot, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return deleteSiteHostNameBindingSlotDelegate(call.execute()); + Validator.validate(siteSourceControl); + Call call = service.createOrUpdateSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return createOrUpdateSiteSourceControlDelegate(call.execute()); } /** - * Deletes a host name binding. + * Update the source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param hostName Name of host + * @param siteSourceControl Request body that contains the source control parameters * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall deleteSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String slot, String hostName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createOrUpdateSiteSourceControlAsync(String resourceGroupName, String name, SiteSourceControl siteSourceControl, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -6938,29 +8543,26 @@ public ServiceCall deleteSiteHostNameBindingSlotAsync(String resourceGroupName, serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } - if (hostName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter hostName is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (siteSourceControl == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.deleteSiteHostNameBindingSlot(resourceGroupName, name, slot, hostName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteSourceControl, serviceCallback); + Call call = service.createOrUpdateSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(deleteSiteHostNameBindingSlotDelegate(response)); + serviceCallback.success(createOrUpdateSiteSourceControlDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -6969,24 +8571,24 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse deleteSiteHostNameBindingSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse createOrUpdateSiteSourceControlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the configuration of the web app. + * Delete source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteConfig object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteConfig(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse deleteSiteSourceControl(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -6999,12 +8601,12 @@ public ServiceResponse getSiteConfig(String resourceGroupName, Strin if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteConfig(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteConfigDelegate(call.execute()); + Call call = service.deleteSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteSiteSourceControlDelegate(call.execute()); } /** - * Gets the configuration of the web app. + * Delete source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -7012,7 +8614,7 @@ public ServiceResponse getSiteConfig(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteConfigAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall deleteSiteSourceControlAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -7032,13 +8634,13 @@ public ServiceCall getSiteConfigAsync(String resourceGroupName, String name, fin serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteConfig(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.deleteSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteConfigDelegate(response)); + serviceCallback.success(deleteSiteSourceControlDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -7047,25 +8649,25 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse deleteSiteSourceControlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Update the configuration of web app. + * Update the source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param siteConfig Request body that contains the configuraiton setting for the web app + * @param siteSourceControl Request body that contains the source control parameters * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteConfig object wrapped in {@link ServiceResponse} if successful. + * @return the SiteSourceControl object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse createOrUpdateSiteConfig(String resourceGroupName, String name, SiteConfig siteConfig) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteSourceControl(String resourceGroupName, String name, SiteSourceControl siteSourceControl) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7075,28 +8677,28 @@ public ServiceResponse createOrUpdateSiteConfig(String resourceGroup if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (siteConfig == null) { - throw new IllegalArgumentException("Parameter siteConfig is required and cannot be null."); + if (siteSourceControl == null) { + throw new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(siteConfig); - Call call = service.createOrUpdateSiteConfig(resourceGroupName, name, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return createOrUpdateSiteConfigDelegate(call.execute()); + Validator.validate(siteSourceControl); + Call call = service.updateSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteSourceControlDelegate(call.execute()); } /** - * Update the configuration of web app. + * Update the source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param siteConfig Request body that contains the configuraiton setting for the web app + * @param siteSourceControl Request body that contains the source control parameters * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall createOrUpdateSiteConfigAsync(String resourceGroupName, String name, SiteConfig siteConfig, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteSourceControlAsync(String resourceGroupName, String name, SiteSourceControl siteSourceControl, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -7112,22 +8714,22 @@ public ServiceCall createOrUpdateSiteConfigAsync(String resourceGroupName, Strin serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (siteConfig == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); + if (siteSourceControl == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(siteConfig, serviceCallback); - Call call = service.createOrUpdateSiteConfig(resourceGroupName, name, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteSourceControl, serviceCallback); + Call call = service.updateSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(createOrUpdateSiteConfigDelegate(response)); + serviceCallback.success(updateSiteSourceControlDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -7136,56 +8738,55 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse createOrUpdateSiteConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteSourceControlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Update the configuration of web app. + * Get the source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param siteConfig Request body that contains the configuraiton setting for the web app + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteConfig object wrapped in {@link ServiceResponse} if successful. + * @return the SiteSourceControl object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteConfig(String resourceGroupName, String name, SiteConfig siteConfig) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteSourceControlSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (siteConfig == null) { - throw new IllegalArgumentException("Parameter siteConfig is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(siteConfig); - Call call = service.updateSiteConfig(resourceGroupName, name, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteConfigDelegate(call.execute()); + Call call = service.getSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteSourceControlSlotDelegate(call.execute()); } /** - * Update the configuration of web app. + * Get the source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param siteConfig Request body that contains the configuraiton setting for the web app + * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteConfigAsync(String resourceGroupName, String name, SiteConfig siteConfig, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -7197,26 +8798,25 @@ public ServiceCall updateSiteConfigAsync(String resourceGroupName, String name, serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (this.client.getSubscriptionId() == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } - if (siteConfig == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(siteConfig, serviceCallback); - Call call = service.updateSiteConfig(resourceGroupName, name, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteConfigDelegate(response)); + serviceCallback.success(getSiteSourceControlSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -7225,25 +8825,26 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteSourceControlSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the configuration of the web app. + * Update the source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteSourceControl Request body that contains the source control parameters * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteConfig object wrapped in {@link ServiceResponse} if successful. + * @return the SiteSourceControl object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteConfigSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse createOrUpdateSiteSourceControlSlot(String resourceGroupName, String name, String slot, SiteSourceControl siteSourceControl) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7256,24 +8857,29 @@ public ServiceResponse getSiteConfigSlot(String resourceGroupName, S if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (siteSourceControl == null) { + throw new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteConfigSlotDelegate(call.execute()); + Validator.validate(siteSourceControl); + Call call = service.createOrUpdateSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return createOrUpdateSiteSourceControlSlotDelegate(call.execute()); } /** - * Gets the configuration of the web app. + * Update the source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteSourceControl Request body that contains the source control parameters * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteConfigSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createOrUpdateSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, SiteSourceControl siteSourceControl, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -7293,17 +8899,22 @@ public ServiceCall getSiteConfigSlotAsync(String resourceGroupName, String name, serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (siteSourceControl == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteSourceControl, serviceCallback); + Call call = service.createOrUpdateSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteConfigSlotDelegate(response)); + serviceCallback.success(createOrUpdateSiteSourceControlSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -7312,26 +8923,25 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteConfigSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse createOrUpdateSiteSourceControlSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Update the configuration of web app. + * Delete source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteConfig Request body that contains the configuraiton setting for the web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteConfig object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse createOrUpdateSiteConfigSlot(String resourceGroupName, String name, String slot, SiteConfig siteConfig) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse deleteSiteSourceControlSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7344,29 +8954,24 @@ public ServiceResponse createOrUpdateSiteConfigSlot(String resourceG if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (siteConfig == null) { - throw new IllegalArgumentException("Parameter siteConfig is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(siteConfig); - Call call = service.createOrUpdateSiteConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return createOrUpdateSiteConfigSlotDelegate(call.execute()); + Call call = service.deleteSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteSiteSourceControlSlotDelegate(call.execute()); } /** - * Update the configuration of web app. + * Delete source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteConfig Request body that contains the configuraiton setting for the web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall createOrUpdateSiteConfigSlotAsync(String resourceGroupName, String name, String slot, SiteConfig siteConfig, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall deleteSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -7386,22 +8991,17 @@ public ServiceCall createOrUpdateSiteConfigSlotAsync(String resourceGroupName, S serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (siteConfig == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(siteConfig, serviceCallback); - Call call = service.createOrUpdateSiteConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.deleteSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(createOrUpdateSiteConfigSlotDelegate(response)); + serviceCallback.success(deleteSiteSourceControlSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -7410,26 +9010,26 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse createOrUpdateSiteConfigSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse deleteSiteSourceControlSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Update the configuration of web app. + * Update the source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteConfig Request body that contains the configuraiton setting for the web app + * @param siteSourceControl Request body that contains the source control parameters * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteConfig object wrapped in {@link ServiceResponse} if successful. + * @return the SiteSourceControl object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteConfigSlot(String resourceGroupName, String name, String slot, SiteConfig siteConfig) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteSourceControlSlot(String resourceGroupName, String name, String slot, SiteSourceControl siteSourceControl) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7442,29 +9042,29 @@ public ServiceResponse updateSiteConfigSlot(String resourceGroupName if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (siteConfig == null) { - throw new IllegalArgumentException("Parameter siteConfig is required and cannot be null."); + if (siteSourceControl == null) { + throw new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(siteConfig); - Call call = service.updateSiteConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteConfigSlotDelegate(call.execute()); + Validator.validate(siteSourceControl); + Call call = service.updateSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteSourceControlSlotDelegate(call.execute()); } /** - * Update the configuration of web app. + * Update the source control configuration of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteConfig Request body that contains the configuraiton setting for the web app + * @param siteSourceControl Request body that contains the source control parameters * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteConfigSlotAsync(String resourceGroupName, String name, String slot, SiteConfig siteConfig, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, SiteSourceControl siteSourceControl, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -7484,22 +9084,22 @@ public ServiceCall updateSiteConfigSlotAsync(String resourceGroupName, String na serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (siteConfig == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); + if (siteSourceControl == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(siteConfig, serviceCallback); - Call call = service.updateSiteConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteSourceControl, serviceCallback); + Call call = service.updateSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteConfigSlotDelegate(response)); + serviceCallback.success(updateSiteSourceControlSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -7508,24 +9108,24 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteConfigSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteSourceControlSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Get the source control configuration of web app. + * Gets the application settings of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteSourceControl object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteSourceControl(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSiteAppSettings(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7538,12 +9138,12 @@ public ServiceResponse getSiteSourceControl(String resourceGr if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteSourceControlDelegate(call.execute()); + Call call = service.listSiteAppSettings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return listSiteAppSettingsDelegate(call.execute()); } /** - * Get the source control configuration of web app. + * Gets the application settings of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -7551,7 +9151,7 @@ public ServiceResponse getSiteSourceControl(String resourceGr * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteSourceControlAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSiteAppSettingsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -7571,13 +9171,13 @@ public ServiceCall getSiteSourceControlAsync(String resourceGroupName, String na serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.listSiteAppSettings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteSourceControlDelegate(response)); + serviceCallback.success(listSiteAppSettingsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -7586,56 +9186,55 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteSourceControlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listSiteAppSettingsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Update the source control configuration of web app. + * Gets the application settings of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param siteSourceControl Request body that contains the source control parameters + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteSourceControl object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse createOrUpdateSiteSourceControl(String resourceGroupName, String name, SiteSourceControl siteSourceControl) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSiteAppSettingsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (siteSourceControl == null) { - throw new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(siteSourceControl); - Call call = service.createOrUpdateSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return createOrUpdateSiteSourceControlDelegate(call.execute()); + Call call = service.listSiteAppSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return listSiteAppSettingsSlotDelegate(call.execute()); } /** - * Update the source control configuration of web app. + * Gets the application settings of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param siteSourceControl Request body that contains the source control parameters + * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall createOrUpdateSiteSourceControlAsync(String resourceGroupName, String name, SiteSourceControl siteSourceControl, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSiteAppSettingsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -7647,26 +9246,25 @@ public ServiceCall createOrUpdateSiteSourceControlAsync(String resourceGroupName serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (this.client.getSubscriptionId() == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } - if (siteSourceControl == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(siteSourceControl, serviceCallback); - Call call = service.createOrUpdateSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.listSiteAppSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(createOrUpdateSiteSourceControlDelegate(response)); + serviceCallback.success(listSiteAppSettingsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -7675,24 +9273,25 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse createOrUpdateSiteSourceControlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listSiteAppSettingsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Delete source control configuration of web app. + * Updates the application settings of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param appSettings Application settings of web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse deleteSiteSourceControl(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteAppSettings(String resourceGroupName, String name, StringDictionary appSettings) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7702,23 +9301,28 @@ public ServiceResponse deleteSiteSourceControl(String resourceGroupName, if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (appSettings == null) { + throw new IllegalArgumentException("Parameter appSettings is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.deleteSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return deleteSiteSourceControlDelegate(call.execute()); + Validator.validate(appSettings); + Call call = service.updateSiteAppSettings(resourceGroupName, name, this.client.getSubscriptionId(), appSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteAppSettingsDelegate(call.execute()); } /** - * Delete source control configuration of web app. + * Updates the application settings of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param appSettings Application settings of web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall deleteSiteSourceControlAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteAppSettingsAsync(String resourceGroupName, String name, StringDictionary appSettings, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -7734,17 +9338,22 @@ public ServiceCall deleteSiteSourceControlAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (appSettings == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter appSettings is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.deleteSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(appSettings, serviceCallback); + Call call = service.updateSiteAppSettings(resourceGroupName, name, this.client.getSubscriptionId(), appSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(deleteSiteSourceControlDelegate(response)); + serviceCallback.success(updateSiteAppSettingsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -7753,56 +9362,61 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse deleteSiteSourceControlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteAppSettingsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Update the source control configuration of web app. + * Updates the application settings of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param siteSourceControl Request body that contains the source control parameters + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param appSettings Application settings of web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteSourceControl object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteSourceControl(String resourceGroupName, String name, SiteSourceControl siteSourceControl) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteAppSettingsSlot(String resourceGroupName, String name, String slot, StringDictionary appSettings) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (siteSourceControl == null) { - throw new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null."); + if (appSettings == null) { + throw new IllegalArgumentException("Parameter appSettings is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(siteSourceControl); - Call call = service.updateSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteSourceControlDelegate(call.execute()); + Validator.validate(appSettings); + Call call = service.updateSiteAppSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), appSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteAppSettingsSlotDelegate(call.execute()); } /** - * Update the source control configuration of web app. + * Updates the application settings of web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param siteSourceControl Request body that contains the source control parameters + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param appSettings Application settings of web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteSourceControlAsync(String resourceGroupName, String name, SiteSourceControl siteSourceControl, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteAppSettingsSlotAsync(String resourceGroupName, String name, String slot, StringDictionary appSettings, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -7814,26 +9428,30 @@ public ServiceCall updateSiteSourceControlAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (siteSourceControl == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); + if (appSettings == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter appSettings is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(siteSourceControl, serviceCallback); - Call call = service.updateSiteSourceControl(resourceGroupName, name, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(appSettings, serviceCallback); + Call call = service.updateSiteAppSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), appSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteSourceControlDelegate(response)); + serviceCallback.success(updateSiteAppSettingsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -7842,55 +9460,50 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteSourceControlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteAppSettingsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Get the source control configuration of web app. + * Gets the connection strings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteSourceControl object wrapped in {@link ServiceResponse} if successful. + * @return the ConnectionStringDictionary object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteSourceControlSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSiteConnectionStrings(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteSourceControlSlotDelegate(call.execute()); + Call call = service.listSiteConnectionStrings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return listSiteConnectionStringsDelegate(call.execute()); } /** - * Get the source control configuration of web app. + * Gets the connection strings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSiteConnectionStringsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -7902,10 +9515,6 @@ public ServiceCall getSiteSourceControlSlotAsync(String resourceGroupName, Strin serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; @@ -7914,13 +9523,13 @@ public ServiceCall getSiteSourceControlSlotAsync(String resourceGroupName, Strin serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.listSiteConnectionStrings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteSourceControlSlotDelegate(response)); + serviceCallback.success(listSiteConnectionStringsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -7929,26 +9538,25 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteSourceControlSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listSiteConnectionStringsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Update the source control configuration of web app. + * Gets the connection strings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteSourceControl Request body that contains the source control parameters * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteSourceControl object wrapped in {@link ServiceResponse} if successful. + * @return the ConnectionStringDictionary object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse createOrUpdateSiteSourceControlSlot(String resourceGroupName, String name, String slot, SiteSourceControl siteSourceControl) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSiteConnectionStringsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7961,29 +9569,24 @@ public ServiceResponse createOrUpdateSiteSourceControlSlot(St if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (siteSourceControl == null) { - throw new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(siteSourceControl); - Call call = service.createOrUpdateSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return createOrUpdateSiteSourceControlSlotDelegate(call.execute()); + Call call = service.listSiteConnectionStringsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return listSiteConnectionStringsSlotDelegate(call.execute()); } /** - * Update the source control configuration of web app. + * Gets the connection strings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteSourceControl Request body that contains the source control parameters * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall createOrUpdateSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, SiteSourceControl siteSourceControl, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSiteConnectionStringsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -8003,22 +9606,17 @@ public ServiceCall createOrUpdateSiteSourceControlSlotAsync(String resourceGroup serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (siteSourceControl == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(siteSourceControl, serviceCallback); - Call call = service.createOrUpdateSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.listSiteConnectionStringsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(createOrUpdateSiteSourceControlSlotDelegate(response)); + serviceCallback.success(listSiteConnectionStringsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -8027,55 +9625,56 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse createOrUpdateSiteSourceControlSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listSiteConnectionStringsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Delete source control configuration of web app. + * Updates the connection strings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. + * @param connectionStrings Connection strings associated with web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the ConnectionStringDictionary object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse deleteSiteSourceControlSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteConnectionStrings(String resourceGroupName, String name, ConnectionStringDictionary connectionStrings) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (connectionStrings == null) { + throw new IllegalArgumentException("Parameter connectionStrings is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.deleteSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return deleteSiteSourceControlSlotDelegate(call.execute()); + Validator.validate(connectionStrings); + Call call = service.updateSiteConnectionStrings(resourceGroupName, name, this.client.getSubscriptionId(), connectionStrings, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteConnectionStringsDelegate(call.execute()); } /** - * Delete source control configuration of web app. + * Updates the connection strings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. + * @param connectionStrings Connection strings associated with web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall deleteSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteConnectionStringsAsync(String resourceGroupName, String name, ConnectionStringDictionary connectionStrings, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -8087,25 +9686,26 @@ public ServiceCall deleteSiteSourceControlSlotAsync(String resourceGroupName, St serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (connectionStrings == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter connectionStrings is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.deleteSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(connectionStrings, serviceCallback); + Call call = service.updateSiteConnectionStrings(resourceGroupName, name, this.client.getSubscriptionId(), connectionStrings, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(deleteSiteSourceControlSlotDelegate(response)); + serviceCallback.success(updateSiteConnectionStringsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -8114,26 +9714,26 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse deleteSiteSourceControlSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteConnectionStringsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Update the source control configuration of web app. + * Updates the connection strings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteSourceControl Request body that contains the source control parameters + * @param connectionStrings Connection strings associated with web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteSourceControl object wrapped in {@link ServiceResponse} if successful. + * @return the ConnectionStringDictionary object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteSourceControlSlot(String resourceGroupName, String name, String slot, SiteSourceControl siteSourceControl) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteConnectionStringsSlot(String resourceGroupName, String name, String slot, ConnectionStringDictionary connectionStrings) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8146,29 +9746,29 @@ public ServiceResponse updateSiteSourceControlSlot(String res if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (siteSourceControl == null) { - throw new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null."); + if (connectionStrings == null) { + throw new IllegalArgumentException("Parameter connectionStrings is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(siteSourceControl); - Call call = service.updateSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteSourceControlSlotDelegate(call.execute()); + Validator.validate(connectionStrings); + Call call = service.updateSiteConnectionStringsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), connectionStrings, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteConnectionStringsSlotDelegate(call.execute()); } /** - * Update the source control configuration of web app. + * Updates the connection strings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteSourceControl Request body that contains the source control parameters + * @param connectionStrings Connection strings associated with web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, SiteSourceControl siteSourceControl, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteConnectionStringsSlotAsync(String resourceGroupName, String name, String slot, ConnectionStringDictionary connectionStrings, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -8188,22 +9788,22 @@ public ServiceCall updateSiteSourceControlSlotAsync(String resourceGroupName, St serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (siteSourceControl == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); + if (connectionStrings == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter connectionStrings is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(siteSourceControl, serviceCallback); - Call call = service.updateSiteSourceControlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteSourceControl, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(connectionStrings, serviceCallback); + Call call = service.updateSiteConnectionStringsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), connectionStrings, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteSourceControlSlotDelegate(response)); + serviceCallback.success(updateSiteConnectionStringsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -8212,24 +9812,24 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteSourceControlSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteConnectionStringsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the application settings of web app. + * Gets the Authentication / Authorization settings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. + * @return the SiteAuthSettings object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse listSiteAppSettings(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSiteAuthSettings(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8242,12 +9842,12 @@ public ServiceResponse listSiteAppSettings(String resourceGrou if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.listSiteAppSettings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return listSiteAppSettingsDelegate(call.execute()); + Call call = service.listSiteAuthSettings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return listSiteAuthSettingsDelegate(call.execute()); } /** - * Gets the application settings of web app. + * Gets the Authentication / Authorization settings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -8255,7 +9855,7 @@ public ServiceResponse listSiteAppSettings(String resourceGrou * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall listSiteAppSettingsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSiteAuthSettingsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -8275,13 +9875,13 @@ public ServiceCall listSiteAppSettingsAsync(String resourceGroupName, String nam serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.listSiteAppSettings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.listSiteAuthSettings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(listSiteAppSettingsDelegate(response)); + serviceCallback.success(listSiteAuthSettingsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -8290,15 +9890,15 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse listSiteAppSettingsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listSiteAuthSettingsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the application settings of web app. + * Gets the Authentication / Authorization settings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -8306,9 +9906,9 @@ private ServiceResponse listSiteAppSettingsDelegate(Response listSiteAppSettingsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSiteAuthSettingsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8324,12 +9924,12 @@ public ServiceResponse listSiteAppSettingsSlot(String resource if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.listSiteAppSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return listSiteAppSettingsSlotDelegate(call.execute()); + Call call = service.listSiteAuthSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return listSiteAuthSettingsSlotDelegate(call.execute()); } /** - * Gets the application settings of web app. + * Gets the Authentication / Authorization settings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -8338,7 +9938,7 @@ public ServiceResponse listSiteAppSettingsSlot(String resource * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall listSiteAppSettingsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSiteAuthSettingsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -8362,13 +9962,13 @@ public ServiceCall listSiteAppSettingsSlotAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.listSiteAppSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.listSiteAuthSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(listSiteAppSettingsSlotDelegate(response)); + serviceCallback.success(listSiteAuthSettingsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -8377,25 +9977,25 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse listSiteAppSettingsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listSiteAuthSettingsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Updates the application settings of web app. + * Updates the Authentication / Authorization settings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param appSettings Application settings of web app + * @param siteAuthSettings Auth settings associated with web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. + * @return the SiteAuthSettings object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteAppSettings(String resourceGroupName, String name, StringDictionary appSettings) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteAuthSettings(String resourceGroupName, String name, SiteAuthSettings siteAuthSettings) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8405,28 +10005,28 @@ public ServiceResponse updateSiteAppSettings(String resourceGr if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (appSettings == null) { - throw new IllegalArgumentException("Parameter appSettings is required and cannot be null."); + if (siteAuthSettings == null) { + throw new IllegalArgumentException("Parameter siteAuthSettings is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(appSettings); - Call call = service.updateSiteAppSettings(resourceGroupName, name, this.client.getSubscriptionId(), appSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteAppSettingsDelegate(call.execute()); + Validator.validate(siteAuthSettings); + Call call = service.updateSiteAuthSettings(resourceGroupName, name, this.client.getSubscriptionId(), siteAuthSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteAuthSettingsDelegate(call.execute()); } /** - * Updates the application settings of web app. + * Updates the Authentication / Authorization settings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param appSettings Application settings of web app + * @param siteAuthSettings Auth settings associated with web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteAppSettingsAsync(String resourceGroupName, String name, StringDictionary appSettings, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteAuthSettingsAsync(String resourceGroupName, String name, SiteAuthSettings siteAuthSettings, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -8442,22 +10042,22 @@ public ServiceCall updateSiteAppSettingsAsync(String resourceGroupName, String n serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (appSettings == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter appSettings is required and cannot be null.")); + if (siteAuthSettings == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteAuthSettings is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(appSettings, serviceCallback); - Call call = service.updateSiteAppSettings(resourceGroupName, name, this.client.getSubscriptionId(), appSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteAuthSettings, serviceCallback); + Call call = service.updateSiteAuthSettings(resourceGroupName, name, this.client.getSubscriptionId(), siteAuthSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteAppSettingsDelegate(response)); + serviceCallback.success(updateSiteAuthSettingsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -8466,26 +10066,26 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteAppSettingsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteAuthSettingsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Updates the application settings of web app. + * Updates the Authentication / Authorization settings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param appSettings Application settings of web app + * @param siteAuthSettings Auth settings associated with web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. + * @return the SiteAuthSettings object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteAppSettingsSlot(String resourceGroupName, String name, String slot, StringDictionary appSettings) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteAuthSettingsSlot(String resourceGroupName, String name, String slot, SiteAuthSettings siteAuthSettings) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8498,29 +10098,29 @@ public ServiceResponse updateSiteAppSettingsSlot(String resour if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (appSettings == null) { - throw new IllegalArgumentException("Parameter appSettings is required and cannot be null."); + if (siteAuthSettings == null) { + throw new IllegalArgumentException("Parameter siteAuthSettings is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(appSettings); - Call call = service.updateSiteAppSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), appSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteAppSettingsSlotDelegate(call.execute()); + Validator.validate(siteAuthSettings); + Call call = service.updateSiteAuthSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteAuthSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteAuthSettingsSlotDelegate(call.execute()); } /** - * Updates the application settings of web app. + * Updates the Authentication / Authorization settings associated with web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param appSettings Application settings of web app + * @param siteAuthSettings Auth settings associated with web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteAppSettingsSlotAsync(String resourceGroupName, String name, String slot, StringDictionary appSettings, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteAuthSettingsSlotAsync(String resourceGroupName, String name, String slot, SiteAuthSettings siteAuthSettings, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -8540,22 +10140,22 @@ public ServiceCall updateSiteAppSettingsSlotAsync(String resourceGroupName, Stri serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (appSettings == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter appSettings is required and cannot be null.")); + if (siteAuthSettings == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteAuthSettings is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(appSettings, serviceCallback); - Call call = service.updateSiteAppSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), appSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteAuthSettings, serviceCallback); + Call call = service.updateSiteAuthSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteAuthSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteAppSettingsSlotDelegate(response)); + serviceCallback.success(updateSiteAuthSettingsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -8564,24 +10164,25 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteAppSettingsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteAuthSettingsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the connection strings associated with web app. + * Gets the web app publishing credentials. * * @param resourceGroupName Name of resource group * @param name Name of web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ConnectionStringDictionary object wrapped in {@link ServiceResponse} if successful. + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the User object wrapped in ServiceResponse if successful. */ - public ServiceResponse listSiteConnectionStrings(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSitePublishingCredentials(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8594,103 +10195,87 @@ public ServiceResponse listSiteConnectionStrings(Str if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.listSiteConnectionStrings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return listSiteConnectionStringsDelegate(call.execute()); + Response result = service.listSitePublishingCredentials(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); } /** - * Gets the connection strings associated with web app. + * Gets the web app publishing credentials. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null - * @return the {@link Call} object + * @return the {@link ServiceCall} object */ - public ServiceCall listSiteConnectionStringsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSitePublishingCredentialsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } if (resourceGroupName == null) { serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - return null; } if (name == null) { serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); - return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); - return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); - return null; } - Call call = service.listSiteConnectionStrings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.listSitePublishingCredentials(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } @Override public void onResponse(Call call, Response response) { - try { - serviceCallback.success(listSiteConnectionStringsDelegate(response)); - } catch (CloudException | IOException exception) { - serviceCallback.failure(exception); - } + client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); } }); return serviceCall; } - private ServiceResponse listSiteConnectionStringsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** - * Gets the connection strings associated with web app. + * Gets the web app publishing credentials. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ConnectionStringDictionary object wrapped in {@link ServiceResponse} if successful. + * @return the User object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse listSiteConnectionStringsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse beginListSitePublishingCredentials(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.listSiteConnectionStringsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return listSiteConnectionStringsSlotDelegate(call.execute()); + Call call = service.beginListSitePublishingCredentials(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginListSitePublishingCredentialsDelegate(call.execute()); } /** - * Gets the connection strings associated with web app. + * Gets the web app publishing credentials. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall listSiteConnectionStringsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall beginListSitePublishingCredentialsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -8702,10 +10287,6 @@ public ServiceCall listSiteConnectionStringsSlotAsync(String resourceGroupName, serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; @@ -8714,13 +10295,13 @@ public ServiceCall listSiteConnectionStringsSlotAsync(String resourceGroupName, serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.listSiteConnectionStringsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.beginListSitePublishingCredentials(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(listSiteConnectionStringsSlotDelegate(response)); + serviceCallback.success(beginListSitePublishingCredentialsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -8729,115 +10310,101 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse listSiteConnectionStringsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginListSitePublishingCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Updates the connection strings associated with web app. + * Gets the web app publishing credentials. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param connectionStrings Connection strings associated with web app + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ConnectionStringDictionary object wrapped in {@link ServiceResponse} if successful. + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the User object wrapped in ServiceResponse if successful. */ - public ServiceResponse updateSiteConnectionStrings(String resourceGroupName, String name, ConnectionStringDictionary connectionStrings) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSitePublishingCredentialsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException, InterruptedException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (connectionStrings == null) { - throw new IllegalArgumentException("Parameter connectionStrings is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(connectionStrings); - Call call = service.updateSiteConnectionStrings(resourceGroupName, name, this.client.getSubscriptionId(), connectionStrings, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteConnectionStringsDelegate(call.execute()); + Response result = service.listSitePublishingCredentialsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); } /** - * Updates the connection strings associated with web app. + * Gets the web app publishing credentials. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param connectionStrings Connection strings associated with web app + * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null - * @return the {@link Call} object + * @return the {@link ServiceCall} object */ - public ServiceCall updateSiteConnectionStringsAsync(String resourceGroupName, String name, ConnectionStringDictionary connectionStrings, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSitePublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } if (resourceGroupName == null) { serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - return null; } if (name == null) { serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); - return null; + } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); - return null; - } - if (connectionStrings == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter connectionStrings is required and cannot be null.")); - return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); - return null; } - Validator.validate(connectionStrings, serviceCallback); - Call call = service.updateSiteConnectionStrings(resourceGroupName, name, this.client.getSubscriptionId(), connectionStrings, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.listSitePublishingCredentialsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new Callback() { @Override - public void onResponse(Call call, Response response) { - try { - serviceCallback.success(updateSiteConnectionStringsDelegate(response)); - } catch (CloudException | IOException exception) { - serviceCallback.failure(exception); - } + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); } }); return serviceCall; } - private ServiceResponse updateSiteConnectionStringsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** - * Updates the connection strings associated with web app. + * Gets the web app publishing credentials. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param connectionStrings Connection strings associated with web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ConnectionStringDictionary object wrapped in {@link ServiceResponse} if successful. + * @return the User object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteConnectionStringsSlot(String resourceGroupName, String name, String slot, ConnectionStringDictionary connectionStrings) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse beginListSitePublishingCredentialsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8850,29 +10417,24 @@ public ServiceResponse updateSiteConnectionStringsSl if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (connectionStrings == null) { - throw new IllegalArgumentException("Parameter connectionStrings is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(connectionStrings); - Call call = service.updateSiteConnectionStringsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), connectionStrings, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteConnectionStringsSlotDelegate(call.execute()); + Call call = service.beginListSitePublishingCredentialsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginListSitePublishingCredentialsSlotDelegate(call.execute()); } /** - * Updates the connection strings associated with web app. + * Gets the web app publishing credentials. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param connectionStrings Connection strings associated with web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteConnectionStringsSlotAsync(String resourceGroupName, String name, String slot, ConnectionStringDictionary connectionStrings, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall beginListSitePublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -8892,22 +10454,17 @@ public ServiceCall updateSiteConnectionStringsSlotAsync(String resourceGroupName serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (connectionStrings == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter connectionStrings is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(connectionStrings, serviceCallback); - Call call = service.updateSiteConnectionStringsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), connectionStrings, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.beginListSitePublishingCredentialsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteConnectionStringsSlotDelegate(response)); + serviceCallback.success(beginListSitePublishingCredentialsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -8916,24 +10473,24 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteConnectionStringsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginListSitePublishingCredentialsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the Authentication / Authorization settings associated with web app. + * Gets the web app meta data. * * @param resourceGroupName Name of resource group * @param name Name of web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteAuthSettings object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse listSiteAuthSettings(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSiteMetadata(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8946,12 +10503,12 @@ public ServiceResponse listSiteAuthSettings(String resourceGro if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.listSiteAuthSettings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return listSiteAuthSettingsDelegate(call.execute()); + Call call = service.listSiteMetadata(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return listSiteMetadataDelegate(call.execute()); } /** - * Gets the Authentication / Authorization settings associated with web app. + * Gets the web app meta data. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -8959,7 +10516,7 @@ public ServiceResponse listSiteAuthSettings(String resourceGro * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall listSiteAuthSettingsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSiteMetadataAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -8979,13 +10536,13 @@ public ServiceCall listSiteAuthSettingsAsync(String resourceGroupName, String na serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.listSiteAuthSettings(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.listSiteMetadata(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(listSiteAuthSettingsDelegate(response)); + serviceCallback.success(listSiteMetadataDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -8994,15 +10551,15 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse listSiteAuthSettingsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listSiteMetadataDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the Authentication / Authorization settings associated with web app. + * Gets the web app meta data. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -9010,9 +10567,9 @@ private ServiceResponse listSiteAuthSettingsDelegate(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteAuthSettings object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse listSiteAuthSettingsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSiteMetadataSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9028,12 +10585,12 @@ public ServiceResponse listSiteAuthSettingsSlot(String resourc if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.listSiteAuthSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return listSiteAuthSettingsSlotDelegate(call.execute()); + Call call = service.listSiteMetadataSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return listSiteMetadataSlotDelegate(call.execute()); } /** - * Gets the Authentication / Authorization settings associated with web app. + * Gets the web app meta data. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -9042,7 +10599,7 @@ public ServiceResponse listSiteAuthSettingsSlot(String resourc * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall listSiteAuthSettingsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSiteMetadataSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -9066,13 +10623,13 @@ public ServiceCall listSiteAuthSettingsSlotAsync(String resourceGroupName, Strin serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.listSiteAuthSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.listSiteMetadataSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(listSiteAuthSettingsSlotDelegate(response)); + serviceCallback.success(listSiteMetadataSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -9081,25 +10638,25 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse listSiteAuthSettingsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listSiteMetadataSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Updates the Authentication / Authorization settings associated with web app. + * Updates the meta data for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param siteAuthSettings Auth settings associated with web app + * @param metadata Meta data of web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteAuthSettings object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteAuthSettings(String resourceGroupName, String name, SiteAuthSettings siteAuthSettings) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteMetadata(String resourceGroupName, String name, StringDictionary metadata) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9109,28 +10666,28 @@ public ServiceResponse updateSiteAuthSettings(String resourceG if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (siteAuthSettings == null) { - throw new IllegalArgumentException("Parameter siteAuthSettings is required and cannot be null."); + if (metadata == null) { + throw new IllegalArgumentException("Parameter metadata is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(siteAuthSettings); - Call call = service.updateSiteAuthSettings(resourceGroupName, name, this.client.getSubscriptionId(), siteAuthSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteAuthSettingsDelegate(call.execute()); + Validator.validate(metadata); + Call call = service.updateSiteMetadata(resourceGroupName, name, this.client.getSubscriptionId(), metadata, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteMetadataDelegate(call.execute()); } /** - * Updates the Authentication / Authorization settings associated with web app. + * Updates the meta data for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param siteAuthSettings Auth settings associated with web app + * @param metadata Meta data of web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteAuthSettingsAsync(String resourceGroupName, String name, SiteAuthSettings siteAuthSettings, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteMetadataAsync(String resourceGroupName, String name, StringDictionary metadata, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -9146,22 +10703,22 @@ public ServiceCall updateSiteAuthSettingsAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (siteAuthSettings == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter siteAuthSettings is required and cannot be null.")); + if (metadata == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter metadata is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(siteAuthSettings, serviceCallback); - Call call = service.updateSiteAuthSettings(resourceGroupName, name, this.client.getSubscriptionId(), siteAuthSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(metadata, serviceCallback); + Call call = service.updateSiteMetadata(resourceGroupName, name, this.client.getSubscriptionId(), metadata, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteAuthSettingsDelegate(response)); + serviceCallback.success(updateSiteMetadataDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -9170,26 +10727,26 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteAuthSettingsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteMetadataDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Updates the Authentication / Authorization settings associated with web app. + * Updates the meta data for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteAuthSettings Auth settings associated with web app + * @param metadata Meta data of web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteAuthSettings object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteAuthSettingsSlot(String resourceGroupName, String name, String slot, SiteAuthSettings siteAuthSettings) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteMetadataSlot(String resourceGroupName, String name, String slot, StringDictionary metadata) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9202,29 +10759,29 @@ public ServiceResponse updateSiteAuthSettingsSlot(String resou if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (siteAuthSettings == null) { - throw new IllegalArgumentException("Parameter siteAuthSettings is required and cannot be null."); + if (metadata == null) { + throw new IllegalArgumentException("Parameter metadata is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(siteAuthSettings); - Call call = service.updateSiteAuthSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteAuthSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteAuthSettingsSlotDelegate(call.execute()); + Validator.validate(metadata); + Call call = service.updateSiteMetadataSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), metadata, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteMetadataSlotDelegate(call.execute()); } /** - * Updates the Authentication / Authorization settings associated with web app. + * Updates the meta data for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteAuthSettings Auth settings associated with web app + * @param metadata Meta data of web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteAuthSettingsSlotAsync(String resourceGroupName, String name, String slot, SiteAuthSettings siteAuthSettings, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteMetadataSlotAsync(String resourceGroupName, String name, String slot, StringDictionary metadata, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -9244,22 +10801,22 @@ public ServiceCall updateSiteAuthSettingsSlotAsync(String resourceGroupName, Str serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (siteAuthSettings == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter siteAuthSettings is required and cannot be null.")); + if (metadata == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter metadata is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(siteAuthSettings, serviceCallback); - Call call = service.updateSiteAuthSettingsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteAuthSettings, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(metadata, serviceCallback); + Call call = service.updateSiteMetadataSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), metadata, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteAuthSettingsSlotDelegate(response)); + serviceCallback.success(updateSiteMetadataSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -9268,92 +10825,24 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteAuthSettingsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteMetadataSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the web app publishing credentials. - * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @throws CloudException exception thrown from REST call - * @throws IOException exception thrown from serialization/deserialization - * @throws IllegalArgumentException exception thrown from invalid parameters - * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the User object wrapped in ServiceResponse if successful. - */ - public ServiceResponse listSitePublishingCredentials(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (name == null) { - throw new IllegalArgumentException("Parameter name is required and cannot be null."); - } - if (this.client.getSubscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); - } - if (this.client.getApiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); - } - Response result = service.listSitePublishingCredentials(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); - return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); - } - - /** - * Gets the web app publishing credentials. - * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if callback is null - * @return the {@link ServiceCall} object - */ - public ServiceCall listSitePublishingCredentialsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { - if (serviceCallback == null) { - throw new IllegalArgumentException("ServiceCallback is required for async calls."); - } - if (resourceGroupName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (this.client.getApiVersion() == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); - } - Call call = service.listSitePublishingCredentials(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new Callback() { - @Override - public void onFailure(Call call, Throwable t) { - serviceCallback.failure(t); - } - @Override - public void onResponse(Call call, Response response) { - client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); - } - }); - return serviceCall; - } - - /** - * Gets the web app publishing credentials. + * Gets the web app logs configuration. * * @param resourceGroupName Name of resource group * @param name Name of web app * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the User object wrapped in {@link ServiceResponse} if successful. + * @return the SiteLogsConfig object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse beginListSitePublishingCredentials(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteLogsConfig(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9366,12 +10855,12 @@ public ServiceResponse beginListSitePublishingCredentials(String resourceG if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.beginListSitePublishingCredentials(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return beginListSitePublishingCredentialsDelegate(call.execute()); + Call call = service.getSiteLogsConfig(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteLogsConfigDelegate(call.execute()); } /** - * Gets the web app publishing credentials. + * Gets the web app logs configuration. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -9379,7 +10868,7 @@ public ServiceResponse beginListSitePublishingCredentials(String resourceG * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall beginListSitePublishingCredentialsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteLogsConfigAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -9399,13 +10888,13 @@ public ServiceCall beginListSitePublishingCredentialsAsync(String resourceGroupN serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.beginListSitePublishingCredentials(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteLogsConfig(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(beginListSitePublishingCredentialsDelegate(response)); + serviceCallback.success(getSiteLogsConfigDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -9414,91 +10903,104 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse beginListSitePublishingCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteLogsConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the web app publishing credentials. + * Updates the meta data for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteLogsConfig Site logs configuration * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the User object wrapped in ServiceResponse if successful. + * @return the SiteLogsConfig object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse listSitePublishingCredentialsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + public ServiceResponse updateSiteLogsConfig(String resourceGroupName, String name, SiteLogsConfig siteLogsConfig) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (siteLogsConfig == null) { + throw new IllegalArgumentException("Parameter siteLogsConfig is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Response result = service.listSitePublishingCredentialsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); - return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); + Validator.validate(siteLogsConfig); + Call call = service.updateSiteLogsConfig(resourceGroupName, name, this.client.getSubscriptionId(), siteLogsConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteLogsConfigDelegate(call.execute()); } /** - * Gets the web app publishing credentials. + * Updates the meta data for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteLogsConfig Site logs configuration * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null - * @return the {@link ServiceCall} object + * @return the {@link Call} object */ - public ServiceCall listSitePublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteLogsConfigAsync(String resourceGroupName, String name, SiteLogsConfig siteLogsConfig, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } if (resourceGroupName == null) { serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; } if (name == null) { serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (siteLogsConfig == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteLogsConfig is required and cannot be null.")); + return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; } - Call call = service.listSitePublishingCredentialsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteLogsConfig, serviceCallback); + Call call = service.updateSiteLogsConfig(resourceGroupName, name, this.client.getSubscriptionId(), siteLogsConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new Callback() { - @Override - public void onFailure(Call call, Throwable t) { - serviceCallback.failure(t); - } + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { - client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + try { + serviceCallback.success(updateSiteLogsConfigDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } } }); return serviceCall; } + private ServiceResponse updateSiteLogsConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** - * Gets the web app publishing credentials. + * Gets the web app logs configuration. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -9506,9 +11008,9 @@ public void onResponse(Call call, Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the User object wrapped in {@link ServiceResponse} if successful. + * @return the SiteLogsConfig object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse beginListSitePublishingCredentialsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteLogsConfigSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9524,12 +11026,12 @@ public ServiceResponse beginListSitePublishingCredentialsSlot(String resou if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.beginListSitePublishingCredentialsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return beginListSitePublishingCredentialsSlotDelegate(call.execute()); + Call call = service.getSiteLogsConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteLogsConfigSlotDelegate(call.execute()); } /** - * Gets the web app publishing credentials. + * Gets the web app logs configuration. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -9538,7 +11040,7 @@ public ServiceResponse beginListSitePublishingCredentialsSlot(String resou * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall beginListSitePublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteLogsConfigSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -9562,13 +11064,13 @@ public ServiceCall beginListSitePublishingCredentialsSlotAsync(String resourceGr serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.beginListSitePublishingCredentialsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteLogsConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(beginListSitePublishingCredentialsSlotDelegate(response)); + serviceCallback.success(getSiteLogsConfigSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -9577,50 +11079,61 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse beginListSitePublishingCredentialsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteLogsConfigSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the web app meta data. + * Updates the meta data for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteLogsConfig Site logs configuration * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. + * @return the SiteLogsConfig object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse listSiteMetadata(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteLogsConfigSlot(String resourceGroupName, String name, String slot, SiteLogsConfig siteLogsConfig) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (siteLogsConfig == null) { + throw new IllegalArgumentException("Parameter siteLogsConfig is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.listSiteMetadata(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return listSiteMetadataDelegate(call.execute()); + Validator.validate(siteLogsConfig); + Call call = service.updateSiteLogsConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteLogsConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteLogsConfigSlotDelegate(call.execute()); } /** - * Gets the web app meta data. + * Updates the meta data for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteLogsConfig Site logs configuration * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall listSiteMetadataAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteLogsConfigSlotAsync(String resourceGroupName, String name, String slot, SiteLogsConfig siteLogsConfig, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -9632,21 +11145,30 @@ public ServiceCall listSiteMetadataAsync(String resourceGroupName, String name, serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (siteLogsConfig == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter siteLogsConfig is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.listSiteMetadata(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(siteLogsConfig, serviceCallback); + Call call = service.updateSiteLogsConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteLogsConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(listSiteMetadataDelegate(response)); + serviceCallback.success(updateSiteLogsConfigSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -9655,25 +11177,24 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse listSiteMetadataDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteLogsConfigSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the web app meta data. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. + * @param resourceGroupName the String value + * @param name the String value + * @param slot the String value * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse listSiteMetadataSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSitePremierAddOnsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9689,21 +11210,20 @@ public ServiceResponse listSiteMetadataSlot(String resourceGro if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.listSiteMetadataSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return listSiteMetadataSlotDelegate(call.execute()); + Call call = service.listSitePremierAddOnsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return listSitePremierAddOnsSlotDelegate(call.execute()); } /** - * Gets the web app meta data. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. + * @param resourceGroupName the String value + * @param name the String value + * @param slot the String value * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall listSiteMetadataSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSitePremierAddOnsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -9727,13 +11247,13 @@ public ServiceCall listSiteMetadataSlotAsync(String resourceGroupName, String na serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.listSiteMetadataSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.listSitePremierAddOnsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(listSiteMetadataSlotDelegate(response)); + serviceCallback.success(listSitePremierAddOnsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -9742,25 +11262,23 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse listSiteMetadataSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listSitePremierAddOnsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Updates the meta data for web app. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param metadata Meta data of web app + * @param resourceGroupName the String value + * @param name the String value * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteMetadata(String resourceGroupName, String name, StringDictionary metadata) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSitePremierAddOns(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9770,28 +11288,22 @@ public ServiceResponse updateSiteMetadata(String resourceGroup if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (metadata == null) { - throw new IllegalArgumentException("Parameter metadata is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(metadata); - Call call = service.updateSiteMetadata(resourceGroupName, name, this.client.getSubscriptionId(), metadata, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteMetadataDelegate(call.execute()); + Call call = service.listSitePremierAddOns(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return listSitePremierAddOnsDelegate(call.execute()); } /** - * Updates the meta data for web app. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param metadata Meta data of web app + * @param resourceGroupName the String value + * @param name the String value * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteMetadataAsync(String resourceGroupName, String name, StringDictionary metadata, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSitePremierAddOnsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -9807,22 +11319,17 @@ public ServiceCall updateSiteMetadataAsync(String resourceGroupName, String name serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (metadata == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter metadata is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(metadata, serviceCallback); - Call call = service.updateSiteMetadata(resourceGroupName, name, this.client.getSubscriptionId(), metadata, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.listSitePremierAddOns(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteMetadataDelegate(response)); + serviceCallback.success(listSitePremierAddOnsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -9831,61 +11338,58 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteMetadataDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listSitePremierAddOnsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Updates the meta data for web app. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param metadata Meta data of web app + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value + * @param slot the String value * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionary object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteMetadataSlot(String resourceGroupName, String name, String slot, StringDictionary metadata) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSitePremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (premierAddOnName == null) { + throw new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null."); + } if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } - if (this.client.getSubscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); - } - if (metadata == null) { - throw new IllegalArgumentException("Parameter metadata is required and cannot be null."); + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(metadata); - Call call = service.updateSiteMetadataSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), metadata, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteMetadataSlotDelegate(call.execute()); + Call call = service.getSitePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSitePremierAddOnSlotDelegate(call.execute()); } /** - * Updates the meta data for web app. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param metadata Meta data of web app + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value + * @param slot the String value * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteMetadataSlotAsync(String resourceGroupName, String name, String slot, StringDictionary metadata, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -9897,6 +11401,10 @@ public ServiceCall updateSiteMetadataSlotAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (premierAddOnName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); + return null; + } if (slot == null) { serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; @@ -9905,22 +11413,17 @@ public ServiceCall updateSiteMetadataSlotAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (metadata == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter metadata is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(metadata, serviceCallback); - Call call = service.updateSiteMetadataSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), metadata, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSitePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteMetadataSlotDelegate(response)); + serviceCallback.success(getSitePremierAddOnSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -9929,50 +11432,64 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteMetadataSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSitePremierAddOnSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the web app logs configuration. * - * @param resourceGroupName Name of resource group - * @param name Name of web app + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value + * @param slot the String value + * @param premierAddOn the PremierAddOnRequest value * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteLogsConfig object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteLogsConfig(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse addSitePremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnRequest premierAddOn) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (premierAddOnName == null) { + throw new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (premierAddOn == null) { + throw new IllegalArgumentException("Parameter premierAddOn is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteLogsConfig(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteLogsConfigDelegate(call.execute()); + Validator.validate(premierAddOn); + Call call = service.addSitePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, this.client.getSubscriptionId(), premierAddOn, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return addSitePremierAddOnSlotDelegate(call.execute()); } /** - * Gets the web app logs configuration. * - * @param resourceGroupName Name of resource group - * @param name Name of web app + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value + * @param slot the String value + * @param premierAddOn the PremierAddOnRequest value * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteLogsConfigAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall addSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnRequest premierAddOn, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -9984,21 +11501,34 @@ public ServiceCall getSiteLogsConfigAsync(String resourceGroupName, String name, serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (premierAddOnName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); + return null; + } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (premierAddOn == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOn is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteLogsConfig(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(premierAddOn, serviceCallback); + Call call = service.addSitePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, this.client.getSubscriptionId(), premierAddOn, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteLogsConfigDelegate(response)); + serviceCallback.success(addSitePremierAddOnSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -10007,56 +11537,58 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteLogsConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse addSitePremierAddOnSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Updates the meta data for web app. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param siteLogsConfig Site logs configuration + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value + * @param slot the String value * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteLogsConfig object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteLogsConfig(String resourceGroupName, String name, SiteLogsConfig siteLogsConfig) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse deleteSitePremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (premierAddOnName == null) { + throw new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (siteLogsConfig == null) { - throw new IllegalArgumentException("Parameter siteLogsConfig is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(siteLogsConfig); - Call call = service.updateSiteLogsConfig(resourceGroupName, name, this.client.getSubscriptionId(), siteLogsConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteLogsConfigDelegate(call.execute()); + Call call = service.deleteSitePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteSitePremierAddOnSlotDelegate(call.execute()); } /** - * Updates the meta data for web app. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param siteLogsConfig Site logs configuration + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value + * @param slot the String value * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteLogsConfigAsync(String resourceGroupName, String name, SiteLogsConfig siteLogsConfig, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall deleteSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -10068,26 +11600,29 @@ public ServiceCall updateSiteLogsConfigAsync(String resourceGroupName, String na serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (this.client.getSubscriptionId() == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (premierAddOnName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); return null; } - if (siteLogsConfig == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter siteLogsConfig is required and cannot be null.")); + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(siteLogsConfig, serviceCallback); - Call call = service.updateSiteLogsConfig(resourceGroupName, name, this.client.getSubscriptionId(), siteLogsConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.deleteSitePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteLogsConfigDelegate(response)); + serviceCallback.success(deleteSitePremierAddOnSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -10096,33 +11631,32 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteLogsConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse deleteSitePremierAddOnSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the web app logs configuration. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteLogsConfig object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteLogsConfigSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSitePremierAddOn(String resourceGroupName, String name, String premierAddOnName) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + if (premierAddOnName == null) { + throw new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); @@ -10130,21 +11664,20 @@ public ServiceResponse getSiteLogsConfigSlot(String resourceGrou if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteLogsConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteLogsConfigSlotDelegate(call.execute()); + Call call = service.getSitePremierAddOn(resourceGroupName, name, premierAddOnName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSitePremierAddOnDelegate(call.execute()); } /** - * Gets the web app logs configuration. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteLogsConfigSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -10156,8 +11689,8 @@ public ServiceCall getSiteLogsConfigSlotAsync(String resourceGroupName, String n serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + if (premierAddOnName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { @@ -10168,13 +11701,13 @@ public ServiceCall getSiteLogsConfigSlotAsync(String resourceGroupName, String n serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteLogsConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSitePremierAddOn(resourceGroupName, name, premierAddOnName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteLogsConfigSlotDelegate(response)); + serviceCallback.success(getSitePremierAddOnDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -10183,61 +11716,59 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteLogsConfigSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSitePremierAddOnDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Updates the meta data for web app. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteLogsConfig Site logs configuration + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value + * @param premierAddOn the PremierAddOnRequest value * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteLogsConfig object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteLogsConfigSlot(String resourceGroupName, String name, String slot, SiteLogsConfig siteLogsConfig) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse addSitePremierAddOn(String resourceGroupName, String name, String premierAddOnName, PremierAddOnRequest premierAddOn) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + if (premierAddOnName == null) { + throw new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (siteLogsConfig == null) { - throw new IllegalArgumentException("Parameter siteLogsConfig is required and cannot be null."); + if (premierAddOn == null) { + throw new IllegalArgumentException("Parameter premierAddOn is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(siteLogsConfig); - Call call = service.updateSiteLogsConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteLogsConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteLogsConfigSlotDelegate(call.execute()); + Validator.validate(premierAddOn); + Call call = service.addSitePremierAddOn(resourceGroupName, name, premierAddOnName, this.client.getSubscriptionId(), premierAddOn, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return addSitePremierAddOnDelegate(call.execute()); } /** - * Updates the meta data for web app. * - * @param resourceGroupName Name of resource group - * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteLogsConfig Site logs configuration + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value + * @param premierAddOn the PremierAddOnRequest value * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteLogsConfigSlotAsync(String resourceGroupName, String name, String slot, SiteLogsConfig siteLogsConfig, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall addSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName, PremierAddOnRequest premierAddOn, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -10249,30 +11780,30 @@ public ServiceCall updateSiteLogsConfigSlotAsync(String resourceGroupName, Strin serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + if (premierAddOnName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (siteLogsConfig == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter siteLogsConfig is required and cannot be null.")); + if (premierAddOn == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOn is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(siteLogsConfig, serviceCallback); - Call call = service.updateSiteLogsConfigSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), siteLogsConfig, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(premierAddOn, serviceCallback); + Call call = service.addSitePremierAddOn(resourceGroupName, name, premierAddOnName, this.client.getSubscriptionId(), premierAddOn, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteLogsConfigSlotDelegate(response)); + serviceCallback.success(addSitePremierAddOnDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -10281,9 +11812,9 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteLogsConfigSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse addSitePremierAddOnDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -10292,21 +11823,21 @@ private ServiceResponse updateSiteLogsConfigSlotDelegate(Respons * * @param resourceGroupName the String value * @param name the String value - * @param slot the String value + * @param premierAddOnName the String value * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse listSitePremierAddOnsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse deleteSitePremierAddOn(String resourceGroupName, String name, String premierAddOnName) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + if (premierAddOnName == null) { + throw new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); @@ -10314,20 +11845,20 @@ public ServiceResponse listSitePremierAddOnsSlot(String resourceGroupNam if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.listSitePremierAddOnsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return listSitePremierAddOnsSlotDelegate(call.execute()); + Call call = service.deleteSitePremierAddOn(resourceGroupName, name, premierAddOnName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteSitePremierAddOnDelegate(call.execute()); } /** * * @param resourceGroupName the String value * @param name the String value - * @param slot the String value + * @param premierAddOnName the String value * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall listSitePremierAddOnsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall deleteSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -10339,8 +11870,8 @@ public ServiceCall listSitePremierAddOnsSlotAsync(String resourceGroupName, Stri serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + if (premierAddOnName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { @@ -10351,13 +11882,13 @@ public ServiceCall listSitePremierAddOnsSlotAsync(String resourceGroupName, Stri serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.listSitePremierAddOnsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.deleteSitePremierAddOn(resourceGroupName, name, premierAddOnName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(listSitePremierAddOnsSlotDelegate(response)); + serviceCallback.success(deleteSitePremierAddOnDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -10366,7 +11897,7 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse listSitePremierAddOnsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse deleteSitePremierAddOnDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) @@ -10374,15 +11905,16 @@ private ServiceResponse listSitePremierAddOnsSlotDelegate(Response listSitePremierAddOns(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteBackupConfiguration(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10395,19 +11927,20 @@ public ServiceResponse listSitePremierAddOns(String resourceGroupName, S if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.listSitePremierAddOns(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return listSitePremierAddOnsDelegate(call.execute()); + Call call = service.getSiteBackupConfiguration(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteBackupConfigurationDelegate(call.execute()); } /** + * Gets the backup configuration for a web app. * - * @param resourceGroupName the String value - * @param name the String value + * @param resourceGroupName Name of resource group + * @param name Name of web app * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall listSitePremierAddOnsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteBackupConfigurationAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -10427,13 +11960,13 @@ public ServiceCall listSitePremierAddOnsAsync(String resourceGroupName, String n serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.listSitePremierAddOns(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteBackupConfiguration(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(listSitePremierAddOnsDelegate(response)); + serviceCallback.success(getSiteBackupConfigurationDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -10442,34 +11975,31 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse listSitePremierAddOnsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteBackupConfigurationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** + * Gets the backup configuration for a web app. * - * @param resourceGroupName the String value - * @param name the String value - * @param premierAddOnName the String value - * @param slot the String value + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the BackupRequest object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSitePremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteBackupConfigurationSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (premierAddOnName == null) { - throw new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null."); - } if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } @@ -10479,21 +12009,21 @@ public ServiceResponse getSitePremierAddOnSlot(String resourceGroupName, if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSitePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSitePremierAddOnSlotDelegate(call.execute()); + Call call = service.getSiteBackupConfigurationSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteBackupConfigurationSlotDelegate(call.execute()); } /** + * Gets the backup configuration for a web app. * - * @param resourceGroupName the String value - * @param name the String value - * @param premierAddOnName the String value - * @param slot the String value + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteBackupConfigurationSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -10505,10 +12035,6 @@ public ServiceCall getSitePremierAddOnSlotAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (premierAddOnName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - return null; - } if (slot == null) { serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; @@ -10521,13 +12047,13 @@ public ServiceCall getSitePremierAddOnSlotAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSitePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteBackupConfigurationSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSitePremierAddOnSlotDelegate(response)); + serviceCallback.success(getSiteBackupConfigurationSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -10536,64 +12062,56 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSitePremierAddOnSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteBackupConfigurationSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** + * Updates backup configuration of web app. * - * @param resourceGroupName the String value - * @param name the String value - * @param premierAddOnName the String value - * @param slot the String value - * @param premierAddOn the PremierAddOnRequest value + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param request Information on backup request * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the BackupRequest object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse addSitePremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnRequest premierAddOn) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteBackupConfiguration(String resourceGroupName, String name, BackupRequest request) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (premierAddOnName == null) { - throw new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null."); - } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (premierAddOn == null) { - throw new IllegalArgumentException("Parameter premierAddOn is required and cannot be null."); + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(premierAddOn); - Call call = service.addSitePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, this.client.getSubscriptionId(), premierAddOn, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return addSitePremierAddOnSlotDelegate(call.execute()); + Validator.validate(request); + Call call = service.updateSiteBackupConfiguration(resourceGroupName, name, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteBackupConfigurationDelegate(call.execute()); } /** + * Updates backup configuration of web app. * - * @param resourceGroupName the String value - * @param name the String value - * @param premierAddOnName the String value - * @param slot the String value - * @param premierAddOn the PremierAddOnRequest value + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param request Information on backup request * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall addSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnRequest premierAddOn, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteBackupConfigurationAsync(String resourceGroupName, String name, BackupRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -10605,34 +12123,26 @@ public ServiceCall addSitePremierAddOnSlotAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (premierAddOnName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - return null; - } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (premierAddOn == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOn is required and cannot be null.")); + if (request == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(premierAddOn, serviceCallback); - Call call = service.addSitePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, this.client.getSubscriptionId(), premierAddOn, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(request, serviceCallback); + Call call = service.updateSiteBackupConfiguration(resourceGroupName, name, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(addSitePremierAddOnSlotDelegate(response)); + serviceCallback.success(updateSiteBackupConfigurationDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -10641,58 +12151,61 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse addSitePremierAddOnSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteBackupConfigurationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** + * Updates backup configuration of web app. * - * @param resourceGroupName the String value - * @param name the String value - * @param premierAddOnName the String value - * @param slot the String value + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on backup request * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the BackupRequest object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse deleteSitePremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse updateSiteBackupConfigurationSlot(String resourceGroupName, String name, String slot, BackupRequest request) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (premierAddOnName == null) { - throw new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null."); - } if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.deleteSitePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return deleteSitePremierAddOnSlotDelegate(call.execute()); + Validator.validate(request); + Call call = service.updateSiteBackupConfigurationSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateSiteBackupConfigurationSlotDelegate(call.execute()); } /** + * Updates backup configuration of web app. * - * @param resourceGroupName the String value - * @param name the String value - * @param premierAddOnName the String value - * @param slot the String value + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on backup request * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall deleteSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall updateSiteBackupConfigurationSlotAsync(String resourceGroupName, String name, String slot, BackupRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -10704,10 +12217,6 @@ public ServiceCall deleteSitePremierAddOnSlotAsync(String resourceGroupName, Str serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (premierAddOnName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - return null; - } if (slot == null) { serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; @@ -10716,17 +12225,22 @@ public ServiceCall deleteSitePremierAddOnSlotAsync(String resourceGroupName, Str serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (request == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.deleteSitePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(request, serviceCallback); + Call call = service.updateSiteBackupConfigurationSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(deleteSitePremierAddOnSlotDelegate(response)); + serviceCallback.success(updateSiteBackupConfigurationSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -10735,53 +12249,56 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse deleteSitePremierAddOnSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateSiteBackupConfigurationSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** + * Creates web app backup. * - * @param resourceGroupName the String value - * @param name the String value - * @param premierAddOnName the String value + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param request Information on backup request * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the BackupItem object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSitePremierAddOn(String resourceGroupName, String name, String premierAddOnName) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse backupSite(String resourceGroupName, String name, BackupRequest request) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (premierAddOnName == null) { - throw new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSitePremierAddOn(resourceGroupName, name, premierAddOnName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSitePremierAddOnDelegate(call.execute()); + Validator.validate(request); + Call call = service.backupSite(resourceGroupName, name, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return backupSiteDelegate(call.execute()); } /** + * Creates web app backup. * - * @param resourceGroupName the String value - * @param name the String value - * @param premierAddOnName the String value + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param request Information on backup request * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall backupSiteAsync(String resourceGroupName, String name, BackupRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -10793,25 +12310,26 @@ public ServiceCall getSitePremierAddOnAsync(String resourceGroupName, String nam serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (premierAddOnName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (request == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSitePremierAddOn(resourceGroupName, name, premierAddOnName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(request, serviceCallback); + Call call = service.backupSite(resourceGroupName, name, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSitePremierAddOnDelegate(response)); + serviceCallback.success(backupSiteDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -10820,59 +12338,61 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSitePremierAddOnDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse backupSiteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** + * Creates web app backup. * - * @param resourceGroupName the String value - * @param name the String value - * @param premierAddOnName the String value - * @param premierAddOn the PremierAddOnRequest value + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on backup request * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the BackupItem object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse addSitePremierAddOn(String resourceGroupName, String name, String premierAddOnName, PremierAddOnRequest premierAddOn) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse backupSiteSlot(String resourceGroupName, String name, String slot, BackupRequest request) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (premierAddOnName == null) { - throw new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null."); + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (premierAddOn == null) { - throw new IllegalArgumentException("Parameter premierAddOn is required and cannot be null."); + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(premierAddOn); - Call call = service.addSitePremierAddOn(resourceGroupName, name, premierAddOnName, this.client.getSubscriptionId(), premierAddOn, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return addSitePremierAddOnDelegate(call.execute()); + Validator.validate(request); + Call call = service.backupSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return backupSiteSlotDelegate(call.execute()); } /** + * Creates web app backup. * - * @param resourceGroupName the String value - * @param name the String value - * @param premierAddOnName the String value - * @param premierAddOn the PremierAddOnRequest value + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on backup request * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall addSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName, PremierAddOnRequest premierAddOn, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall backupSiteSlotAsync(String resourceGroupName, String name, String slot, BackupRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -10884,30 +12404,30 @@ public ServiceCall addSitePremierAddOnAsync(String resourceGroupName, String nam serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (premierAddOnName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (premierAddOn == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOn is required and cannot be null.")); + if (request == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(premierAddOn, serviceCallback); - Call call = service.addSitePremierAddOn(resourceGroupName, name, premierAddOnName, this.client.getSubscriptionId(), premierAddOn, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(request, serviceCallback); + Call call = service.backupSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(addSitePremierAddOnDelegate(response)); + serviceCallback.success(backupSiteSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -10916,53 +12436,56 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse addSitePremierAddOnDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse backupSiteSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** + * Discovers existing web app backups that can be restored. * - * @param resourceGroupName the String value - * @param name the String value - * @param premierAddOnName the String value + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param request Information on restore request * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the RestoreRequest object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse deleteSitePremierAddOn(String resourceGroupName, String name, String premierAddOnName) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse discoverSiteRestore(String resourceGroupName, String name, RestoreRequest request) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (premierAddOnName == null) { - throw new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.deleteSitePremierAddOn(resourceGroupName, name, premierAddOnName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return deleteSitePremierAddOnDelegate(call.execute()); + Validator.validate(request); + Call call = service.discoverSiteRestore(resourceGroupName, name, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return discoverSiteRestoreDelegate(call.execute()); } /** + * Discovers existing web app backups that can be restored. * - * @param resourceGroupName the String value - * @param name the String value - * @param premierAddOnName the String value + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param request Information on restore request * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall deleteSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall discoverSiteRestoreAsync(String resourceGroupName, String name, RestoreRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -10974,25 +12497,26 @@ public ServiceCall deleteSitePremierAddOnAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (premierAddOnName == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (request == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.deleteSitePremierAddOn(resourceGroupName, name, premierAddOnName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(request, serviceCallback); + Call call = service.discoverSiteRestore(resourceGroupName, name, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(deleteSitePremierAddOnDelegate(response)); + serviceCallback.success(discoverSiteRestoreDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -11001,50 +12525,61 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse deleteSitePremierAddOnDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse discoverSiteRestoreDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the backup configuration for a web app. + * Discovers existing web app backups that can be restored. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on restore request * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupRequest object wrapped in {@link ServiceResponse} if successful. + * @return the RestoreRequest object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteBackupConfiguration(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse discoverSiteRestoreSlot(String resourceGroupName, String name, String slot, RestoreRequest request) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteBackupConfiguration(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteBackupConfigurationDelegate(call.execute()); + Validator.validate(request); + Call call = service.discoverSiteRestoreSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return discoverSiteRestoreSlotDelegate(call.execute()); } /** - * Gets the backup configuration for a web app. + * Discovers existing web app backups that can be restored. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on restore request * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteBackupConfigurationAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall discoverSiteRestoreSlotAsync(String resourceGroupName, String name, String slot, RestoreRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -11056,21 +12591,30 @@ public ServiceCall getSiteBackupConfigurationAsync(String resourceGroupName, Str serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (request == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteBackupConfiguration(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(request, serviceCallback); + Call call = service.discoverSiteRestoreSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteBackupConfigurationDelegate(response)); + serviceCallback.success(discoverSiteRestoreSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -11079,15 +12623,15 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteBackupConfigurationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse discoverSiteRestoreSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the backup configuration for a web app. + * Lists all available backups for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -11095,9 +12639,9 @@ private ServiceResponse getSiteBackupConfigurationDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupRequest object wrapped in {@link ServiceResponse} if successful. + * @return the BackupItemCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteBackupConfigurationSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSiteBackupsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -11113,12 +12657,12 @@ public ServiceResponse getSiteBackupConfigurationSlot(String reso if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteBackupConfigurationSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteBackupConfigurationSlotDelegate(call.execute()); + Call call = service.listSiteBackupsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return listSiteBackupsSlotDelegate(call.execute()); } /** - * Gets the backup configuration for a web app. + * Lists all available backups for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -11127,7 +12671,7 @@ public ServiceResponse getSiteBackupConfigurationSlot(String reso * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteBackupConfigurationSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSiteBackupsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -11151,13 +12695,13 @@ public ServiceCall getSiteBackupConfigurationSlotAsync(String resourceGroupName, serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteBackupConfigurationSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.listSiteBackupsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteBackupConfigurationSlotDelegate(response)); + serviceCallback.success(listSiteBackupsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -11166,25 +12710,24 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteBackupConfigurationSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listSiteBackupsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Updates backup configuration of web app. + * Lists all available backups for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param request Information on backup request * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupRequest object wrapped in {@link ServiceResponse} if successful. + * @return the BackupItemCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteBackupConfiguration(String resourceGroupName, String name, BackupRequest request) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSiteBackups(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -11194,28 +12737,23 @@ public ServiceResponse updateSiteBackupConfiguration(String resou if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (request == null) { - throw new IllegalArgumentException("Parameter request is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(request); - Call call = service.updateSiteBackupConfiguration(resourceGroupName, name, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteBackupConfigurationDelegate(call.execute()); + Call call = service.listSiteBackups(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return listSiteBackupsDelegate(call.execute()); } /** - * Updates backup configuration of web app. + * Lists all available backups for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param request Information on backup request * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteBackupConfigurationAsync(String resourceGroupName, String name, BackupRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSiteBackupsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -11231,22 +12769,17 @@ public ServiceCall updateSiteBackupConfigurationAsync(String resourceGroupName, serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (request == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(request, serviceCallback); - Call call = service.updateSiteBackupConfiguration(resourceGroupName, name, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.listSiteBackups(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteBackupConfigurationDelegate(response)); + serviceCallback.success(listSiteBackupsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -11255,61 +12788,55 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteBackupConfigurationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listSiteBackupsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Updates backup configuration of web app. + * Gets status of a web app backup that may be in progress. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request + * @param backupId Id of backup * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupRequest object wrapped in {@link ServiceResponse} if successful. + * @return the BackupItem object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse updateSiteBackupConfigurationSlot(String resourceGroupName, String name, String slot, BackupRequest request) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteBackupStatus(String resourceGroupName, String name, String backupId) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + if (backupId == null) { + throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (request == null) { - throw new IllegalArgumentException("Parameter request is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(request); - Call call = service.updateSiteBackupConfigurationSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return updateSiteBackupConfigurationSlotDelegate(call.execute()); + Call call = service.getSiteBackupStatus(resourceGroupName, name, backupId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteBackupStatusDelegate(call.execute()); } /** - * Updates backup configuration of web app. + * Gets status of a web app backup that may be in progress. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request + * @param backupId Id of backup * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall updateSiteBackupConfigurationSlotAsync(String resourceGroupName, String name, String slot, BackupRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteBackupStatusAsync(String resourceGroupName, String name, String backupId, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -11321,30 +12848,25 @@ public ServiceCall updateSiteBackupConfigurationSlotAsync(String resourceGroupNa serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + if (backupId == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (request == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(request, serviceCallback); - Call call = service.updateSiteBackupConfigurationSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteBackupStatus(resourceGroupName, name, backupId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(updateSiteBackupConfigurationSlotDelegate(response)); + serviceCallback.success(getSiteBackupStatusDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -11353,56 +12875,55 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse updateSiteBackupConfigurationSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteBackupStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Creates web app backup. + * Deletes a backup from Azure Storage. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param request Information on backup request + * @param backupId Id of backup * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @return the BackupItem object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse backupSite(String resourceGroupName, String name, BackupRequest request) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse deleteBackup(String resourceGroupName, String name, String backupId) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (backupId == null) { + throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (request == null) { - throw new IllegalArgumentException("Parameter request is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(request); - Call call = service.backupSite(resourceGroupName, name, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return backupSiteDelegate(call.execute()); + Call call = service.deleteBackup(resourceGroupName, name, backupId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteBackupDelegate(call.execute()); } /** - * Creates web app backup. + * Deletes a backup from Azure Storage. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param request Information on backup request + * @param backupId Id of backup * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall backupSiteAsync(String resourceGroupName, String name, BackupRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall deleteBackupAsync(String resourceGroupName, String name, String backupId, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -11414,26 +12935,25 @@ public ServiceCall backupSiteAsync(String resourceGroupName, String name, Backup serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (this.client.getSubscriptionId() == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (backupId == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); return null; } - if (request == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(request, serviceCallback); - Call call = service.backupSite(resourceGroupName, name, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.deleteBackup(resourceGroupName, name, backupId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(backupSiteDelegate(response)); + serviceCallback.success(deleteBackupDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -11442,7 +12962,7 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse backupSiteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse deleteBackupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) @@ -11450,53 +12970,52 @@ private ServiceResponse backupSiteDelegate(Response re } /** - * Creates web app backup. + * Gets status of a web app backup that may be in progress. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param backupId Id of backup * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @return the BackupItem object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse backupSiteSlot(String resourceGroupName, String name, String slot, BackupRequest request) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteBackupStatusSlot(String resourceGroupName, String name, String backupId, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (backupId == null) { + throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); + } if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (request == null) { - throw new IllegalArgumentException("Parameter request is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(request); - Call call = service.backupSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return backupSiteSlotDelegate(call.execute()); + Call call = service.getSiteBackupStatusSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteBackupStatusSlotDelegate(call.execute()); } /** - * Creates web app backup. + * Gets status of a web app backup that may be in progress. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param backupId Id of backup * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall backupSiteSlotAsync(String resourceGroupName, String name, String slot, BackupRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteBackupStatusSlotAsync(String resourceGroupName, String name, String backupId, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -11508,6 +13027,10 @@ public ServiceCall backupSiteSlotAsync(String resourceGroupName, String name, St serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (backupId == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); + return null; + } if (slot == null) { serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; @@ -11516,22 +13039,17 @@ public ServiceCall backupSiteSlotAsync(String resourceGroupName, String name, St serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (request == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(request, serviceCallback); - Call call = service.backupSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteBackupStatusSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(backupSiteSlotDelegate(response)); + serviceCallback.success(getSiteBackupStatusSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -11540,7 +13058,7 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse backupSiteSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse getSiteBackupStatusSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) @@ -11548,48 +13066,52 @@ private ServiceResponse backupSiteSlotDelegate(Response discoverSiteRestore(String resourceGroupName, String name, RestoreRequest request) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse deleteBackupSlot(String resourceGroupName, String name, String backupId, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (backupId == null) { + throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (request == null) { - throw new IllegalArgumentException("Parameter request is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(request); - Call call = service.discoverSiteRestore(resourceGroupName, name, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return discoverSiteRestoreDelegate(call.execute()); + Call call = service.deleteBackupSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteBackupSlotDelegate(call.execute()); } /** - * Discovers existing web app backups that can be restored. + * Deletes a backup from Azure Storage. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param request Information on restore request + * @param backupId Id of backup + * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall discoverSiteRestoreAsync(String resourceGroupName, String name, RestoreRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall deleteBackupSlotAsync(String resourceGroupName, String name, String backupId, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -11601,26 +13123,29 @@ public ServiceCall discoverSiteRestoreAsync(String resourceGroupName, String nam serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (this.client.getSubscriptionId() == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (backupId == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); return null; } - if (request == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(request, serviceCallback); - Call call = service.discoverSiteRestore(resourceGroupName, name, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.deleteBackupSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(discoverSiteRestoreDelegate(response)); + serviceCallback.success(deleteBackupSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -11629,34 +13154,34 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse discoverSiteRestoreDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse deleteBackupSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Discovers existing web app backups that can be restored. + * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on restore request + * @param backupId Id of backup + * @param request Information on backup request * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RestoreRequest object wrapped in {@link ServiceResponse} if successful. + * @return the BackupItem object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse discoverSiteRestoreSlot(String resourceGroupName, String name, String slot, RestoreRequest request) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteBackupStatusSecrets(String resourceGroupName, String name, String backupId, BackupRequest request) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + if (backupId == null) { + throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); @@ -11668,22 +13193,22 @@ public ServiceResponse discoverSiteRestoreSlot(String resourceGr throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } Validator.validate(request); - Call call = service.discoverSiteRestoreSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return discoverSiteRestoreSlotDelegate(call.execute()); + Call call = service.getSiteBackupStatusSecrets(resourceGroupName, name, backupId, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteBackupStatusSecretsDelegate(call.execute()); } /** - * Discovers existing web app backups that can be restored. + * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on restore request + * @param backupId Id of backup + * @param request Information on backup request * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall discoverSiteRestoreSlotAsync(String resourceGroupName, String name, String slot, RestoreRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteBackupStatusSecretsAsync(String resourceGroupName, String name, String backupId, BackupRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -11695,8 +13220,8 @@ public ServiceCall discoverSiteRestoreSlotAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + if (backupId == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { @@ -11712,13 +13237,13 @@ public ServiceCall discoverSiteRestoreSlotAsync(String resourceGroupName, String return null; } Validator.validate(request, serviceCallback); - Call call = service.discoverSiteRestoreSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteBackupStatusSecrets(resourceGroupName, name, backupId, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(discoverSiteRestoreSlotDelegate(response)); + serviceCallback.success(getSiteBackupStatusSecretsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -11727,55 +13252,66 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse discoverSiteRestoreSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteBackupStatusSecretsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Lists all available backups for web app. + * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param backupId Id of backup * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on backup request * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupItemCollection object wrapped in {@link ServiceResponse} if successful. + * @return the BackupItem object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse listSiteBackupsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteBackupStatusSecretsSlot(String resourceGroupName, String name, String backupId, String slot, BackupRequest request) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (backupId == null) { + throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); + } if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.listSiteBackupsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return listSiteBackupsSlotDelegate(call.execute()); + Validator.validate(request); + Call call = service.getSiteBackupStatusSecretsSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteBackupStatusSecretsSlotDelegate(call.execute()); } /** - * Lists all available backups for web app. + * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param backupId Id of backup * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on backup request * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall listSiteBackupsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteBackupStatusSecretsSlotAsync(String resourceGroupName, String name, String backupId, String slot, BackupRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -11787,6 +13323,10 @@ public ServiceCall listSiteBackupsSlotAsync(String resourceGroupName, String nam serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (backupId == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); + return null; + } if (slot == null) { serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; @@ -11795,17 +13335,22 @@ public ServiceCall listSiteBackupsSlotAsync(String resourceGroupName, String nam serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (request == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.listSiteBackupsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(request, serviceCallback); + Call call = service.getSiteBackupStatusSecretsSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(listSiteBackupsSlotDelegate(response)); + serviceCallback.success(getSiteBackupStatusSecretsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -11814,50 +13359,61 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse listSiteBackupsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteBackupStatusSecretsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Lists all available backups for web app. + * Restores a web app. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param backupId Id of backup to restore + * @param request Information on restore request * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupItemCollection object wrapped in {@link ServiceResponse} if successful. + * @return the RestoreResponse object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse listSiteBackups(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse restoreSite(String resourceGroupName, String name, String backupId, RestoreRequest request) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (backupId == null) { + throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.listSiteBackups(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return listSiteBackupsDelegate(call.execute()); + Validator.validate(request); + Call call = service.restoreSite(resourceGroupName, name, backupId, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return restoreSiteDelegate(call.execute()); } /** - * Lists all available backups for web app. + * Restores a web app. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param backupId Id of backup to restore + * @param request Information on restore request * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall listSiteBackupsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall restoreSiteAsync(String resourceGroupName, String name, String backupId, RestoreRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -11869,21 +13425,30 @@ public ServiceCall listSiteBackupsAsync(String resourceGroupName, String name, f serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (backupId == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (request == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.listSiteBackups(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(request, serviceCallback); + Call call = service.restoreSite(resourceGroupName, name, backupId, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(listSiteBackupsDelegate(response)); + serviceCallback.success(restoreSiteDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -11892,25 +13457,27 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse listSiteBackupsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse restoreSiteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets status of a web app backup that may be in progress. + * Restores a web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup + * @param backupId Id of backup to restore + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on restore request * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupItem object wrapped in {@link ServiceResponse} if successful. + * @return the RestoreResponse object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteBackupStatus(String resourceGroupName, String name, String backupId) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse restoreSiteSlot(String resourceGroupName, String name, String backupId, String slot, RestoreRequest request) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -11920,27 +13487,36 @@ public ServiceResponse getSiteBackupStatus(String resourceGroupName, if (backupId == null) { throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteBackupStatus(resourceGroupName, name, backupId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteBackupStatusDelegate(call.execute()); + Validator.validate(request); + Call call = service.restoreSiteSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return restoreSiteSlotDelegate(call.execute()); } /** - * Gets status of a web app backup that may be in progress. + * Restores a web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup + * @param backupId Id of backup to restore + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on restore request * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteBackupStatusAsync(String resourceGroupName, String name, String backupId, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall restoreSiteSlotAsync(String resourceGroupName, String name, String backupId, String slot, RestoreRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -11956,21 +13532,30 @@ public ServiceCall getSiteBackupStatusAsync(String resourceGroupName, String nam serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); return null; } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } + if (request == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); + return null; + } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteBackupStatus(resourceGroupName, name, backupId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Validator.validate(request, serviceCallback); + Call call = service.restoreSiteSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteBackupStatusDelegate(response)); + serviceCallback.success(restoreSiteSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -11979,33 +13564,33 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteBackupStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse restoreSiteSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Deletes a backup from Azure Storage. + * Gets the quota usage numbers for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupItem object wrapped in {@link ServiceResponse} if successful. + * @return the CsmUsageQuotaCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse deleteBackup(String resourceGroupName, String name, String backupId) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteUsagesSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (backupId == null) { - throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); @@ -12013,21 +13598,22 @@ public ServiceResponse deleteBackup(String resourceGroupName, String if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.deleteBackup(resourceGroupName, name, backupId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return deleteBackupDelegate(call.execute()); + String filter = null; + Call call = service.getSiteUsagesSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteUsagesSlotDelegate(call.execute()); } /** - * Deletes a backup from Azure Storage. + * Gets the quota usage numbers for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup + * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall deleteBackupAsync(String resourceGroupName, String name, String backupId, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteUsagesSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -12039,8 +13625,8 @@ public ServiceCall deleteBackupAsync(String resourceGroupName, String name, Stri serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (backupId == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { @@ -12051,13 +13637,14 @@ public ServiceCall deleteBackupAsync(String resourceGroupName, String name, Stri serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.deleteBackup(resourceGroupName, name, backupId, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final String filter = null; + Call call = service.getSiteUsagesSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(deleteBackupDelegate(response)); + serviceCallback.success(getSiteUsagesSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -12066,35 +13653,25 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse deleteBackupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** - * Gets status of a web app backup that may be in progress. + * Gets the quota usage numbers for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup * @param slot Name of web app slot. If not specified then will default to production slot. + * @param filter Return only usages specified in the filter. Filter is specified by using OData syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupItem object wrapped in {@link ServiceResponse} if successful. + * @return the CsmUsageQuotaCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteBackupStatusSlot(String resourceGroupName, String name, String backupId, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteUsagesSlot(String resourceGroupName, String name, String slot, String filter) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (backupId == null) { - throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); - } if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } @@ -12104,22 +13681,22 @@ public ServiceResponse getSiteBackupStatusSlot(String resourceGroupN if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteBackupStatusSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteBackupStatusSlotDelegate(call.execute()); + Call call = service.getSiteUsagesSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteUsagesSlotDelegate(call.execute()); } /** - * Gets status of a web app backup that may be in progress. + * Gets the quota usage numbers for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup * @param slot Name of web app slot. If not specified then will default to production slot. + * @param filter Return only usages specified in the filter. Filter is specified by using OData syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteBackupStatusSlotAsync(String resourceGroupName, String name, String backupId, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteUsagesSlotAsync(String resourceGroupName, String name, String slot, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -12131,10 +13708,6 @@ public ServiceCall getSiteBackupStatusSlotAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (backupId == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - return null; - } if (slot == null) { serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; @@ -12147,13 +13720,13 @@ public ServiceCall getSiteBackupStatusSlotAsync(String resourceGroupName, String serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteBackupStatusSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteUsagesSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteBackupStatusSlotDelegate(response)); + serviceCallback.success(getSiteUsagesSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -12162,60 +13735,51 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteBackupStatusSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteUsagesSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Deletes a backup from Azure Storage. + * Gets the quota usage numbers for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup - * @param slot Name of web app slot. If not specified then will default to production slot. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupItem object wrapped in {@link ServiceResponse} if successful. + * @return the CsmUsageQuotaCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse deleteBackupSlot(String resourceGroupName, String name, String backupId, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteUsages(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (backupId == null) { - throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); - } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.deleteBackupSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return deleteBackupSlotDelegate(call.execute()); + String filter = null; + Call call = service.getSiteUsages(resourceGroupName, name, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteUsagesDelegate(call.execute()); } /** - * Deletes a backup from Azure Storage. + * Gets the quota usage numbers for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup - * @param slot Name of web app slot. If not specified then will default to production slot. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall deleteBackupSlotAsync(String resourceGroupName, String name, String backupId, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteUsagesAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -12227,14 +13791,6 @@ public ServiceCall deleteBackupSlotAsync(String resourceGroupName, String name, serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (backupId == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - return null; - } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; @@ -12243,13 +13799,14 @@ public ServiceCall deleteBackupSlotAsync(String resourceGroupName, String name, serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.deleteBackupSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final String filter = null; + Call call = service.getSiteUsages(resourceGroupName, name, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(deleteBackupSlotDelegate(response)); + serviceCallback.success(getSiteUsagesDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -12258,61 +13815,45 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse deleteBackupSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + * Gets the quota usage numbers for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup - * @param request Information on backup request + * @param filter Return only usages specified in the filter. Filter is specified by using OData syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupItem object wrapped in {@link ServiceResponse} if successful. + * @return the CsmUsageQuotaCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteBackupStatusSecrets(String resourceGroupName, String name, String backupId, BackupRequest request) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteUsages(String resourceGroupName, String name, String filter) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (backupId == null) { - throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (request == null) { - throw new IllegalArgumentException("Parameter request is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(request); - Call call = service.getSiteBackupStatusSecrets(resourceGroupName, name, backupId, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteBackupStatusSecretsDelegate(call.execute()); + Call call = service.getSiteUsages(resourceGroupName, name, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteUsagesDelegate(call.execute()); } /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + * Gets the quota usage numbers for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup - * @param request Information on backup request + * @param filter Return only usages specified in the filter. Filter is specified by using OData syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteBackupStatusSecretsAsync(String resourceGroupName, String name, String backupId, BackupRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteUsagesAsync(String resourceGroupName, String name, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -12324,30 +13865,21 @@ public ServiceCall getSiteBackupStatusSecretsAsync(String resourceGroupName, Str serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (backupId == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); - return null; - } - if (request == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(request, serviceCallback); - Call call = service.getSiteBackupStatusSecrets(resourceGroupName, name, backupId, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteUsages(resourceGroupName, name, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteBackupStatusSecretsDelegate(response)); + serviceCallback.success(getSiteUsagesDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -12356,66 +13888,57 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteBackupStatusSecretsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteUsagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + * Gets metrics for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupItem object wrapped in {@link ServiceResponse} if successful. + * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteBackupStatusSecretsSlot(String resourceGroupName, String name, String backupId, String slot, BackupRequest request) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteMetricsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (backupId == null) { - throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); - } if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (request == null) { - throw new IllegalArgumentException("Parameter request is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(request); - Call call = service.getSiteBackupStatusSecretsSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteBackupStatusSecretsSlotDelegate(call.execute()); + Boolean details = null; + String filter = null; + Call call = service.getSiteMetricsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteMetricsSlotDelegate(call.execute()); } /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + * Gets metrics for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteBackupStatusSecretsSlotAsync(String resourceGroupName, String name, String backupId, String slot, BackupRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteMetricsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -12427,10 +13950,6 @@ public ServiceCall getSiteBackupStatusSecretsSlotAsync(String resourceGroupName, serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (backupId == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - return null; - } if (slot == null) { serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; @@ -12439,22 +13958,19 @@ public ServiceCall getSiteBackupStatusSecretsSlotAsync(String resourceGroupName, serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (request == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(request, serviceCallback); - Call call = service.getSiteBackupStatusSecretsSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final Boolean details = null; + final String filter = null; + Call call = service.getSiteMetricsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteBackupStatusSecretsSlotDelegate(response)); + serviceCallback.success(getSiteMetricsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -12463,61 +13979,52 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteBackupStatusSecretsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** - * Restores a web app. + * Gets metrics for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup to restore - * @param request Information on restore request + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param details If true, metric details are included in response + * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RestoreResponse object wrapped in {@link ServiceResponse} if successful. + * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse restoreSite(String resourceGroupName, String name, String backupId, RestoreRequest request) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteMetricsSlot(String resourceGroupName, String name, String slot, Boolean details, String filter) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (backupId == null) { - throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (request == null) { - throw new IllegalArgumentException("Parameter request is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(request); - Call call = service.restoreSite(resourceGroupName, name, backupId, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return restoreSiteDelegate(call.execute()); + Call call = service.getSiteMetricsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteMetricsSlotDelegate(call.execute()); } /** - * Restores a web app. + * Gets metrics for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup to restore - * @param request Information on restore request + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param details If true, metric details are included in response + * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall restoreSiteAsync(String resourceGroupName, String name, String backupId, RestoreRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteMetricsSlotAsync(String resourceGroupName, String name, String slot, Boolean details, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -12529,30 +14036,25 @@ public ServiceCall restoreSiteAsync(String resourceGroupName, String name, Strin serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (backupId == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); return null; } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (request == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(request, serviceCallback); - Call call = service.restoreSite(resourceGroupName, name, backupId, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteMetricsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(restoreSiteDelegate(response)); + serviceCallback.success(getSiteMetricsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -12561,66 +14063,52 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse restoreSiteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteMetricsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Restores a web app. + * Gets metrics for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup to restore - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on restore request * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RestoreResponse object wrapped in {@link ServiceResponse} if successful. + * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse restoreSiteSlot(String resourceGroupName, String name, String backupId, String slot, RestoreRequest request) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteMetrics(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (backupId == null) { - throw new IllegalArgumentException("Parameter backupId is required and cannot be null."); - } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - if (request == null) { - throw new IllegalArgumentException("Parameter request is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Validator.validate(request); - Call call = service.restoreSiteSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return restoreSiteSlotDelegate(call.execute()); + Boolean details = null; + String filter = null; + Call call = service.getSiteMetrics(resourceGroupName, name, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteMetricsDelegate(call.execute()); } /** - * Restores a web app. + * Gets metrics for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param backupId Id of backup to restore - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on restore request * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall restoreSiteSlotAsync(String resourceGroupName, String name, String backupId, String slot, RestoreRequest request, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteMetricsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -12632,34 +14120,23 @@ public ServiceCall restoreSiteSlotAsync(String resourceGroupName, String name, S serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (backupId == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - return null; - } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } - if (request == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter request is required and cannot be null.")); - return null; - } if (this.client.getApiVersion() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Validator.validate(request, serviceCallback); - Call call = service.restoreSiteSlot(resourceGroupName, name, backupId, slot, this.client.getSubscriptionId(), request, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final Boolean details = null; + final String filter = null; + Call call = service.getSiteMetrics(resourceGroupName, name, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(restoreSiteSlotDelegate(response)); + serviceCallback.success(getSiteMetricsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -12668,57 +14145,47 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse restoreSiteSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** - * Gets the quota usage numbers for web app. + * Gets metrics for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param filter Return only usages specified in the filter. Filter is specified by using OData syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * @param details If true, metric details are included in response + * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the CsmUsageQuotaCollection object wrapped in {@link ServiceResponse} if successful. + * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteUsagesSlot(String resourceGroupName, String name, String slot, String filter) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteMetrics(String resourceGroupName, String name, Boolean details, String filter) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteUsagesSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteUsagesSlotDelegate(call.execute()); + Call call = service.getSiteMetrics(resourceGroupName, name, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteMetricsDelegate(call.execute()); } /** - * Gets the quota usage numbers for web app. + * Gets metrics for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param filter Return only usages specified in the filter. Filter is specified by using OData syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * @param details If true, metric details are included in response + * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteUsagesSlotAsync(String resourceGroupName, String name, String slot, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteMetricsAsync(String resourceGroupName, String name, Boolean details, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -12730,10 +14197,6 @@ public ServiceCall getSiteUsagesSlotAsync(String resourceGroupName, String name, serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; @@ -12742,13 +14205,13 @@ public ServiceCall getSiteUsagesSlotAsync(String resourceGroupName, String name, serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteUsagesSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteMetrics(resourceGroupName, name, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteUsagesSlotDelegate(response)); + serviceCallback.success(getSiteMetricsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -12757,25 +14220,24 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteUsagesSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the quota usage numbers for web app. + * Gets metric definitions for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param filter Return only usages specified in the filter. Filter is specified by using OData syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the CsmUsageQuotaCollection object wrapped in {@link ServiceResponse} if successful. + * @return the MetricDefinitionCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteUsages(String resourceGroupName, String name, String filter) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteMetricDefinitions(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -12788,21 +14250,20 @@ public ServiceResponse getSiteUsages(String resourceGro if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteUsages(resourceGroupName, name, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteUsagesDelegate(call.execute()); + Call call = service.getSiteMetricDefinitions(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteMetricDefinitionsDelegate(call.execute()); } /** - * Gets the quota usage numbers for web app. + * Gets metric definitions for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param filter Return only usages specified in the filter. Filter is specified by using OData syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteUsagesAsync(String resourceGroupName, String name, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteMetricDefinitionsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -12822,13 +14283,13 @@ public ServiceCall getSiteUsagesAsync(String resourceGroupName, String name, Str serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteUsages(resourceGroupName, name, this.client.getSubscriptionId(), filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteMetricDefinitions(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteUsagesDelegate(response)); + serviceCallback.success(getSiteMetricDefinitionsDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -12837,27 +14298,25 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteUsagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteMetricDefinitionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets metrics for web app. + * Gets metric definitions for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param details If true, metric details are included in response - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. + * @return the MetricDefinitionCollection object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteMetricsSlot(String resourceGroupName, String name, String slot, Boolean details, String filter) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse getSiteMetricDefinitionsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -12873,23 +14332,21 @@ public ServiceResponse getSiteMetricsSlot(String resou if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteMetricsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteMetricsSlotDelegate(call.execute()); + Call call = service.getSiteMetricDefinitionsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getSiteMetricDefinitionsSlotDelegate(call.execute()); } /** - * Gets metrics for web app. + * Gets metric definitions for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param details If true, metric details are included in response - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteMetricsSlotAsync(String resourceGroupName, String name, String slot, Boolean details, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getSiteMetricDefinitionsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -12913,13 +14370,13 @@ public ServiceCall getSiteMetricsSlotAsync(String resourceGroupName, String name serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteMetricsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + Call call = service.getSiteMetricDefinitionsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteMetricsSlotDelegate(response)); + serviceCallback.success(getSiteMetricDefinitionsSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -12928,26 +14385,24 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteMetricsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteMetricDefinitionsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets metrics for web app. + * Gets the publishing profile for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param details If true, metric details are included in response - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ResourceMetricCollection object wrapped in {@link ServiceResponse} if successful. + * @return the InputStream object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteMetrics(String resourceGroupName, String name, Boolean details, String filter) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSitePublishingProfileXml(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -12960,22 +14415,23 @@ public ServiceResponse getSiteMetrics(String resourceG if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteMetrics(resourceGroupName, name, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteMetricsDelegate(call.execute()); + String format = null; + CsmPublishingProfileOptions options = new CsmPublishingProfileOptions(); + options.setFormat(format); + Call call = service.listSitePublishingProfileXml(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), options); + return listSitePublishingProfileXmlDelegate(call.execute()); } /** - * Gets metrics for web app. + * Gets the publishing profile for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param details If true, metric details are included in response - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteMetricsAsync(String resourceGroupName, String name, Boolean details, String filter, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSitePublishingProfileXmlAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -12995,13 +14451,16 @@ public ServiceCall getSiteMetricsAsync(String resourceGroupName, String name, Bo serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteMetrics(resourceGroupName, name, this.client.getSubscriptionId(), details, filter, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final String format = null; + CsmPublishingProfileOptions options = new CsmPublishingProfileOptions(); + options.setFormat(format); + Call call = service.listSitePublishingProfileXml(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), options); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteMetricsDelegate(response)); + serviceCallback.success(listSitePublishingProfileXmlDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -13010,24 +14469,21 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** - * Gets metric definitions for web app. + * Gets the publishing profile for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param format Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the MetricDefinitionCollection object wrapped in {@link ServiceResponse} if successful. + * @return the InputStream object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteMetricDefinitions(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSitePublishingProfileXml(String resourceGroupName, String name, String format) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -13040,20 +14496,26 @@ public ServiceResponse getSiteMetricDefinitions(Stri if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteMetricDefinitions(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteMetricDefinitionsDelegate(call.execute()); + CsmPublishingProfileOptions options = new CsmPublishingProfileOptions(); + options.setFormat(format); + Call call = service.listSitePublishingProfileXml(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), options); + return listSitePublishingProfileXmlDelegate(call.execute()); } /** - * Gets metric definitions for web app. + * Gets the publishing profile for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param format Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteMetricDefinitionsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSitePublishingProfileXmlAsync(String resourceGroupName, String name, String format, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -13073,13 +14535,15 @@ public ServiceCall getSiteMetricDefinitionsAsync(String resourceGroupName, Strin serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteMetricDefinitions(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + CsmPublishingProfileOptions options = new CsmPublishingProfileOptions(); + options.setFormat(format); + Call call = service.listSitePublishingProfileXml(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), options); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteMetricDefinitionsDelegate(response)); + serviceCallback.success(listSitePublishingProfileXmlDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -13088,15 +14552,15 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteMetricDefinitionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listSitePublishingProfileXmlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets metric definitions for web app. + * Gets the publishing profile for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -13104,9 +14568,9 @@ private ServiceResponse getSiteMetricDefinitionsDele * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the MetricDefinitionCollection object wrapped in {@link ServiceResponse} if successful. + * @return the InputStream object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getSiteMetricDefinitionsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSitePublishingProfileXmlSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -13122,12 +14586,15 @@ public ServiceResponse getSiteMetricDefinitionsSlot( if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - Call call = service.getSiteMetricDefinitionsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); - return getSiteMetricDefinitionsSlotDelegate(call.execute()); + String format = null; + CsmPublishingProfileOptions options = new CsmPublishingProfileOptions(); + options.setFormat(format); + Call call = service.listSitePublishingProfileXmlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), options); + return listSitePublishingProfileXmlSlotDelegate(call.execute()); } /** - * Gets metric definitions for web app. + * Gets the publishing profile for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app @@ -13136,7 +14603,7 @@ public ServiceResponse getSiteMetricDefinitionsSlot( * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getSiteMetricDefinitionsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSitePublishingProfileXmlSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -13160,13 +14627,16 @@ public ServiceCall getSiteMetricDefinitionsSlotAsync(String resourceGroupName, S serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - Call call = service.getSiteMetricDefinitionsSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final String format = null; + CsmPublishingProfileOptions options = new CsmPublishingProfileOptions(); + options.setFormat(format); + Call call = service.listSitePublishingProfileXmlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), options); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getSiteMetricDefinitionsSlotDelegate(response)); + serviceCallback.success(listSitePublishingProfileXmlSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -13175,18 +14645,12 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getSiteMetricDefinitionsSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** * Gets the publishing profile for web app. * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. * @param format Name of the format. Valid values are: FileZilla3 WebDeploy -- default @@ -13196,13 +14660,16 @@ private ServiceResponse getSiteMetricDefinitionsSlot * @throws IllegalArgumentException exception thrown from invalid parameters * @return the InputStream object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse listSitePublishingProfileXml(String resourceGroupName, String name, String format) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse listSitePublishingProfileXmlSlot(String resourceGroupName, String name, String slot, String format) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } @@ -13211,8 +14678,8 @@ public ServiceResponse listSitePublishingProfileXml(String resource } CsmPublishingProfileOptions options = new CsmPublishingProfileOptions(); options.setFormat(format); - Call call = service.listSitePublishingProfileXml(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), options); - return listSitePublishingProfileXmlDelegate(call.execute()); + Call call = service.listSitePublishingProfileXmlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), options); + return listSitePublishingProfileXmlSlotDelegate(call.execute()); } /** @@ -13220,6 +14687,7 @@ public ServiceResponse listSitePublishingProfileXml(String resource * * @param resourceGroupName Name of resource group * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. * @param format Name of the format. Valid values are: FileZilla3 WebDeploy -- default @@ -13228,7 +14696,7 @@ public ServiceResponse listSitePublishingProfileXml(String resource * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall listSitePublishingProfileXmlAsync(String resourceGroupName, String name, String format, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall listSitePublishingProfileXmlSlotAsync(String resourceGroupName, String name, String slot, String format, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -13240,6 +14708,10 @@ public ServiceCall listSitePublishingProfileXmlAsync(String resourceGroupName, S serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; @@ -13250,13 +14722,13 @@ public ServiceCall listSitePublishingProfileXmlAsync(String resourceGroupName, S } CsmPublishingProfileOptions options = new CsmPublishingProfileOptions(); options.setFormat(format); - Call call = service.listSitePublishingProfileXml(resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), options); + Call call = service.listSitePublishingProfileXmlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), options); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(listSitePublishingProfileXmlDelegate(response)); + serviceCallback.success(listSitePublishingProfileXmlSlotDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -13265,7 +14737,7 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse listSitePublishingProfileXmlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse listSitePublishingProfileXmlSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) @@ -13273,57 +14745,44 @@ private ServiceResponse listSitePublishingProfileXmlDelegate(Respon } /** - * Gets the publishing profile for web app. + * Restarts web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param format Name of the format. Valid values are: - FileZilla3 - WebDeploy -- default - Ftp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the InputStream object wrapped in {@link ServiceResponse} if successful. + * @return the Object object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse listSitePublishingProfileXmlSlot(String resourceGroupName, String name, String slot, String format) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse restartSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } - CsmPublishingProfileOptions options = new CsmPublishingProfileOptions(); - options.setFormat(format); - Call call = service.listSitePublishingProfileXmlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), options); - return listSitePublishingProfileXmlSlotDelegate(call.execute()); + Boolean softRestart = null; + Boolean synchronous = null; + Call call = service.restartSite(resourceGroupName, name, this.client.getSubscriptionId(), softRestart, synchronous, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return restartSiteDelegate(call.execute()); } /** - * Gets the publishing profile for web app. + * Restarts web app. * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param format Name of the format. Valid values are: - FileZilla3 - WebDeploy -- default - Ftp * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall listSitePublishingProfileXmlSlotAsync(String resourceGroupName, String name, String slot, String format, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall restartSiteAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -13335,10 +14794,6 @@ public ServiceCall listSitePublishingProfileXmlSlotAsync(String resourceGroupNam serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); return null; } - if (slot == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - return null; - } if (this.client.getSubscriptionId() == null) { serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; @@ -13347,15 +14802,15 @@ public ServiceCall listSitePublishingProfileXmlSlotAsync(String resourceGroupNam serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); return null; } - CsmPublishingProfileOptions options = new CsmPublishingProfileOptions(); - options.setFormat(format); - Call call = service.listSitePublishingProfileXmlSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), options); + final Boolean softRestart = null; + final Boolean synchronous = null; + Call call = service.restartSite(resourceGroupName, name, this.client.getSubscriptionId(), softRestart, synchronous, this.client.getApiVersion(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(listSitePublishingProfileXmlSlotDelegate(response)); + serviceCallback.success(restartSiteDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -13364,13 +14819,6 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse listSitePublishingProfileXmlSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** * Restarts web app. * @@ -13453,6 +14901,90 @@ private ServiceResponse restartSiteDelegate(Response respo .build(response); } + /** + * Restarts web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the Object object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse restartSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Boolean softRestart = null; + Boolean synchronous = null; + Call call = service.restartSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), softRestart, synchronous, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return restartSiteSlotDelegate(call.execute()); + } + + /** + * Restarts web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall restartSiteSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (slot == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Boolean softRestart = null; + final Boolean synchronous = null; + Call call = service.restartSiteSlot(resourceGroupName, name, slot, this.client.getSubscriptionId(), softRestart, synchronous, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(restartSiteSlotDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Restarts web app. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/TopLevelDomainsOperations.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/TopLevelDomainsOperations.java index 6313d0bedbce..3fa8841cfdec 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/TopLevelDomainsOperations.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/TopLevelDomainsOperations.java @@ -64,6 +64,26 @@ public interface TopLevelDomainsOperations { */ ServiceCall getTopLevelDomainAsync(String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Lists legal agreements that user needs to accept before purchasing domain. + * + * @param name Name of the top level domain + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the TldLegalAgreementCollection object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse listTopLevelDomainAgreements(String name) throws CloudException, IOException, IllegalArgumentException; + + /** + * Lists legal agreements that user needs to accept before purchasing domain. + * + * @param name Name of the top level domain + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listTopLevelDomainAgreementsAsync(String name, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Lists legal agreements that user needs to accept before purchasing domain. * diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/TopLevelDomainsOperationsImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/TopLevelDomainsOperationsImpl.java index ed6f8c60c476..b4b04324f648 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/TopLevelDomainsOperationsImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/TopLevelDomainsOperationsImpl.java @@ -203,6 +203,74 @@ private ServiceResponse getTopLevelDomainDelegate(Response listTopLevelDomainAgreements(String name) throws CloudException, IOException, IllegalArgumentException { + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Boolean includePrivacy = null; + TopLevelDomainAgreementOption agreementOption = new TopLevelDomainAgreementOption(); + agreementOption.setIncludePrivacy(includePrivacy); + Call call = service.listTopLevelDomainAgreements(name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), agreementOption); + return listTopLevelDomainAgreementsDelegate(call.execute()); + } + + /** + * Lists legal agreements that user needs to accept before purchasing domain. + * + * @param name Name of the top level domain + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listTopLevelDomainAgreementsAsync(String name, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final Boolean includePrivacy = null; + TopLevelDomainAgreementOption agreementOption = new TopLevelDomainAgreementOption(); + agreementOption.setIncludePrivacy(includePrivacy); + Call call = service.listTopLevelDomainAgreements(name, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage(), agreementOption); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(listTopLevelDomainAgreementsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + /** * Lists legal agreements that user needs to accept before purchasing domain. *