From 5382958d04b9c6c82c67e64dfa668322e8e341ab Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 13 Apr 2020 13:28:34 +0000 Subject: [PATCH 1/2] Generated from 84840406aca82a2703a7ae8a370fbb8d3ed5bdba Resolve comments. Signed-off-by: Pan Li --- .../mgmt-v2019_05_01_preview/pom.xml | 4 +- .../v2019_05_01_preview/AppResource.java | 48 +- .../AppResourceProperties.java | 56 +- .../AppResourceProvisioningState.java | 6 + .../CertificateProperties.java | 201 ++++ .../CertificateResource.java | 128 +++ .../v2019_05_01_preview/Certificates.java | 53 + .../CustomDomainProperties.java | 95 ++ .../CustomDomainResource.java | 118 ++ .../CustomDomainValidatePayload.java | 43 + .../CustomDomainValidateResult.java | 30 + .../v2019_05_01_preview/CustomDomains.java | 68 ++ .../DeploymentResourceProperties.java | 9 +- .../DeploymentResourceProvisioningState.java | 4 +- .../DeploymentResourceStatus.java | 3 - .../v2019_05_01_preview/Services.java | 7 +- .../AppPlatformManagementClientImpl.java | 30 + .../implementation/AppPlatformManager.java | 24 + .../implementation/AppResourceImpl.java | 47 +- .../implementation/AppResourceInner.java | 27 + .../implementation/AppsInner.java | 179 ++- .../implementation/BindingsInner.java | 14 +- .../CertificateResourceImpl.java | 142 +++ .../CertificateResourceInner.java | 45 + .../implementation/CertificatesImpl.java | 81 ++ .../implementation/CertificatesInner.java | 681 +++++++++++ .../CustomDomainResourceImpl.java | 138 +++ .../CustomDomainResourceInner.java | 45 + .../CustomDomainValidateResultImpl.java | 36 + .../CustomDomainValidateResultInner.java | 69 ++ .../implementation/CustomDomainsImpl.java | 98 ++ .../implementation/CustomDomainsInner.java | 1024 +++++++++++++++++ .../implementation/DeploymentsInner.java | 42 +- .../implementation/ServicesImpl.java | 8 +- .../implementation/ServicesInner.java | 324 +----- 35 files changed, 3435 insertions(+), 492 deletions(-) create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CertificateProperties.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CertificateResource.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/Certificates.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainProperties.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainResource.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainValidatePayload.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainValidateResult.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomains.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificateResourceImpl.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificateResourceInner.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificatesImpl.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificatesInner.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainResourceImpl.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainResourceInner.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainValidateResultImpl.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainValidateResultInner.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainsImpl.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainsInner.java diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/pom.xml b/sdk/appplatform/mgmt-v2019_05_01_preview/pom.xml index 98f72fb94143..6d091c6304ef 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/pom.xml +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.2.0 + 1.1.0 ../../../pom.management.xml azure-mgmt-appplatform - 1.0.0-beta-1 + 1.0.0-beta jar Microsoft Azure SDK for AppPlatform Management This package contains Microsoft AppPlatform Management SDK. diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResource.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResource.java index e76e0a7f25e0..11342249c40e 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResource.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResource.java @@ -16,7 +16,6 @@ import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.AppPlatformManager; -import org.joda.time.DateTime; /** * Type representing AppResource. @@ -27,6 +26,11 @@ public interface AppResource extends HasInner, Indexable, Upda */ String id(); + /** + * @return the location value. + */ + String location(); + /** * @return the name value. */ @@ -45,7 +49,7 @@ public interface AppResource extends HasInner, Indexable, Upda /** * The entirety of the AppResource definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroupName, DefinitionStages.WithServiceName, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroupName, DefinitionStages.WithServiceName, DefinitionStages.WithCreate { } /** @@ -79,18 +83,30 @@ interface WithServiceName { * @param serviceName The name of the Service resource * @return the next definition stage */ - WithProperties withServiceName(String serviceName); + WithCreate withServiceName(String serviceName); + } + + /** + * The stage of the appresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The GEO location of the application, always the same with its parent resource + * @return the next definition stage + */ + WithCreate withLocation(String location); } /** * The stage of the appresource definition allowing to specify Properties. */ interface WithProperties { - /** - * Specifies properties. - * @param properties Properties of the App resource - * @return the next definition stage - */ + /** + * Specifies properties. + * @param properties Properties of the App resource + * @return the next definition stage + */ WithCreate withProperties(AppResourceProperties properties); } @@ -99,19 +115,31 @@ interface WithProperties { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable { + interface WithCreate extends Creatable, DefinitionStages.WithLocation, DefinitionStages.WithProperties { } } /** * The template for a AppResource update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithProperties { + interface Update extends Appliable, UpdateStages.WithLocation, UpdateStages.WithProperties { } /** * Grouping of AppResource update stages. */ interface UpdateStages { + /** + * The stage of the appresource update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The GEO location of the application, always the same with its parent resource + * @return the next update stage + */ + Update withLocation(String location); + } + /** * The stage of the appresource update allowing to specify Properties. */ diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProperties.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProperties.java index 272ff8751b6c..f3109cec6bb5 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProperties.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProperties.java @@ -29,7 +29,7 @@ public class AppResourceProperties { /** * Provisioning state of the App. Possible values include: 'Succeeded', - * 'Failed'. + * 'Failed', 'Creating', 'Updating'. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private AppResourceProvisioningState provisioningState; @@ -40,6 +40,18 @@ public class AppResourceProperties { @JsonProperty(value = "activeDeploymentName") private String activeDeploymentName; + /** + * Fully qualified dns Name. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /** + * Indicate if only https is allowed. + */ + @JsonProperty(value = "httpsOnly") + private Boolean httpsOnly; + /** * Date time when the resource is created. */ @@ -88,7 +100,7 @@ public String url() { } /** - * Get provisioning state of the App. Possible values include: 'Succeeded', 'Failed'. + * Get provisioning state of the App. Possible values include: 'Succeeded', 'Failed', 'Creating', 'Updating'. * * @return the provisioningState value */ @@ -116,6 +128,46 @@ public AppResourceProperties withActiveDeploymentName(String activeDeploymentNam return this; } + /** + * Get fully qualified dns Name. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set fully qualified dns Name. + * + * @param fqdn the fqdn value to set + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get indicate if only https is allowed. + * + * @return the httpsOnly value + */ + public Boolean httpsOnly() { + return this.httpsOnly; + } + + /** + * Set indicate if only https is allowed. + * + * @param httpsOnly the httpsOnly value to set + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withHttpsOnly(Boolean httpsOnly) { + this.httpsOnly = httpsOnly; + return this; + } + /** * Get date time when the resource is created. * diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProvisioningState.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProvisioningState.java index 75583dfa840c..5de11d53fd2d 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProvisioningState.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProvisioningState.java @@ -22,6 +22,12 @@ public final class AppResourceProvisioningState extends ExpandableStringEnum dnsNames; + + /** + * Get the thumbprint of certificate. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Get the vault uri of user key vault. + * + * @return the vaultUri value + */ + public String vaultUri() { + return this.vaultUri; + } + + /** + * Set the vault uri of user key vault. + * + * @param vaultUri the vaultUri value to set + * @return the CertificateProperties object itself. + */ + public CertificateProperties withVaultUri(String vaultUri) { + this.vaultUri = vaultUri; + return this; + } + + /** + * Get the certificate name of key vault. + * + * @return the keyVaultCertName value + */ + public String keyVaultCertName() { + return this.keyVaultCertName; + } + + /** + * Set the certificate name of key vault. + * + * @param keyVaultCertName the keyVaultCertName value to set + * @return the CertificateProperties object itself. + */ + public CertificateProperties withKeyVaultCertName(String keyVaultCertName) { + this.keyVaultCertName = keyVaultCertName; + return this; + } + + /** + * Get the certificate version of key vault. + * + * @return the certVersion value + */ + public String certVersion() { + return this.certVersion; + } + + /** + * Set the certificate version of key vault. + * + * @param certVersion the certVersion value to set + * @return the CertificateProperties object itself. + */ + public CertificateProperties withCertVersion(String certVersion) { + this.certVersion = certVersion; + return this; + } + + /** + * Get the issuer of certificate. + * + * @return the issuer value + */ + public String issuer() { + return this.issuer; + } + + /** + * Get the issue date of certificate. + * + * @return the issuedDate value + */ + public String issuedDate() { + return this.issuedDate; + } + + /** + * Get the expiration date of certificate. + * + * @return the expirationDate value + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Get the activate date of certificate. + * + * @return the activateDate value + */ + public String activateDate() { + return this.activateDate; + } + + /** + * Get the subject name of certificate. + * + * @return the subjectName value + */ + public String subjectName() { + return this.subjectName; + } + + /** + * Get the domain list of certificate. + * + * @return the dnsNames value + */ + public List dnsNames() { + return this.dnsNames; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CertificateResource.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CertificateResource.java new file mode 100644 index 000000000000..acaf1218f036 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CertificateResource.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.CertificateResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.AppPlatformManager; +import java.util.List; + +/** + * Type representing CertificateResource. + */ +public interface CertificateResource extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + CertificateProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the CertificateResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroupName, DefinitionStages.WithServiceName, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of CertificateResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a CertificateResource definition. + */ + interface Blank extends WithResourceGroupName { + } + + /** + * The stage of the certificateresource definition allowing to specify ResourceGroupName. + */ + interface WithResourceGroupName { + /** + * Specifies resourceGroupName. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal + * @return the next definition stage + */ + WithServiceName withResourceGroupName(String resourceGroupName); + } + + /** + * The stage of the certificateresource definition allowing to specify ServiceName. + */ + interface WithServiceName { + /** + * Specifies serviceName. + * @param serviceName The name of the Service resource + * @return the next definition stage + */ + WithProperties withServiceName(String serviceName); + } + + /** + * The stage of the certificateresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the certificate resource payload + * @return the next definition stage + */ + WithCreate withProperties(CertificateProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a CertificateResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties { + } + + /** + * Grouping of CertificateResource update stages. + */ + interface UpdateStages { + /** + * The stage of the certificateresource update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the certificate resource payload + * @return the next update stage + */ + Update withProperties(CertificateProperties properties); + } + + } +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/Certificates.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/Certificates.java new file mode 100644 index 000000000000..75297d48ed82 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/Certificates.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.CertificatesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Certificates. + */ +public interface Certificates extends SupportsCreating, HasInner { + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serviceName, String certificateName); + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serviceName, String certificateName); + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String serviceName); + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainProperties.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainProperties.java new file mode 100644 index 000000000000..b90e431932c7 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Custom domain of app resource payload. + */ +public class CustomDomainProperties { + /** + * The thumbprint of bound certificate. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** + * The app name of domain. + */ + @JsonProperty(value = "appName") + private String appName; + + /** + * The bound certificate name of domain. + */ + @JsonProperty(value = "certName") + private String certName; + + /** + * Get the thumbprint of bound certificate. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint of bound certificate. + * + * @param thumbprint the thumbprint value to set + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the app name of domain. + * + * @return the appName value + */ + public String appName() { + return this.appName; + } + + /** + * Set the app name of domain. + * + * @param appName the appName value to set + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withAppName(String appName) { + this.appName = appName; + return this; + } + + /** + * Get the bound certificate name of domain. + * + * @return the certName value + */ + public String certName() { + return this.certName; + } + + /** + * Set the bound certificate name of domain. + * + * @param certName the certName value to set + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withCertName(String certName) { + this.certName = certName; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainResource.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainResource.java new file mode 100644 index 000000000000..4cf4c58ec2db --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainResource.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.CustomDomainResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.AppPlatformManager; + +/** + * Type representing CustomDomainResource. + */ +public interface CustomDomainResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + CustomDomainProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the CustomDomainResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithApp, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of CustomDomainResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a CustomDomainResource definition. + */ + interface Blank extends WithApp { + } + + /** + * The stage of the customdomainresource definition allowing to specify App. + */ + interface WithApp { + /** + * Specifies resourceGroupName, serviceName, appName. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal + * @param serviceName The name of the Service resource + * @param appName The name of the App resource + * @return the next definition stage + */ + WithProperties withExistingApp(String resourceGroupName, String serviceName, String appName); + } + + /** + * The stage of the customdomainresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the custom domain resource + * @return the next definition stage + */ + WithCreate withProperties(CustomDomainProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a CustomDomainResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties { + } + + /** + * Grouping of CustomDomainResource update stages. + */ + interface UpdateStages { + /** + * The stage of the customdomainresource update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the custom domain resource + * @return the next update stage + */ + Update withProperties(CustomDomainProperties properties); + } + + } +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainValidatePayload.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainValidatePayload.java new file mode 100644 index 000000000000..3d98677bea07 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainValidatePayload.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Custom domain validate payload. + */ +public class CustomDomainValidatePayload { + /** + * Name to be validated. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get name to be validated. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name to be validated. + * + * @param name the name value to set + * @return the CustomDomainValidatePayload object itself. + */ + public CustomDomainValidatePayload withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainValidateResult.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainValidateResult.java new file mode 100644 index 000000000000..137363c10fed --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomainValidateResult.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.AppPlatformManager; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.CustomDomainValidateResultInner; + +/** + * Type representing CustomDomainValidateResult. + */ +public interface CustomDomainValidateResult extends HasInner, HasManager { + /** + * @return the isValid value. + */ + Boolean isValid(); + + /** + * @return the message value. + */ + String message(); + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomains.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomains.java new file mode 100644 index 000000000000..36efdfb65c06 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CustomDomains.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.CustomDomainsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing CustomDomains. + */ +public interface CustomDomains extends SupportsCreating, HasInner { + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable validateAsync(String resourceGroupName, String serviceName, String appName, String name); + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serviceName, String appName, String domainName); + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String serviceName, final String appName); + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serviceName, String appName, String domainName); + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentResourceProperties.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentResourceProperties.java index b042e3fa267b..973da0e96f5e 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentResourceProperties.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentResourceProperties.java @@ -36,15 +36,14 @@ public class DeploymentResourceProperties { /** * Provisioning state of the Deployment. Possible values include: - * 'Creating', 'Processing', 'Succeeded', 'Failed'. + * 'Creating', 'Updating', 'Succeeded', 'Failed'. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private DeploymentResourceProvisioningState provisioningState; /** * Status of the Deployment. Possible values include: 'Unknown', 'Stopped', - * 'Running', 'Failed', 'Processing', 'Allocating', 'Upgrading', - * 'Compiling'. + * 'Running', 'Failed', 'Allocating', 'Upgrading', 'Compiling'. */ @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private DeploymentResourceStatus status; @@ -117,7 +116,7 @@ public DeploymentResourceProperties withDeploymentSettings(DeploymentSettings de } /** - * Get provisioning state of the Deployment. Possible values include: 'Creating', 'Processing', 'Succeeded', 'Failed'. + * Get provisioning state of the Deployment. Possible values include: 'Creating', 'Updating', 'Succeeded', 'Failed'. * * @return the provisioningState value */ @@ -126,7 +125,7 @@ public DeploymentResourceProvisioningState provisioningState() { } /** - * Get status of the Deployment. Possible values include: 'Unknown', 'Stopped', 'Running', 'Failed', 'Processing', 'Allocating', 'Upgrading', 'Compiling'. + * Get status of the Deployment. Possible values include: 'Unknown', 'Stopped', 'Running', 'Failed', 'Allocating', 'Upgrading', 'Compiling'. * * @return the status value */ diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentResourceProvisioningState.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentResourceProvisioningState.java index f4e3ef7942be..0e694365556a 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentResourceProvisioningState.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentResourceProvisioningState.java @@ -19,8 +19,8 @@ public final class DeploymentResourceProvisioningState extends ExpandableStringE /** Static value Creating for DeploymentResourceProvisioningState. */ public static final DeploymentResourceProvisioningState CREATING = fromString("Creating"); - /** Static value Processing for DeploymentResourceProvisioningState. */ - public static final DeploymentResourceProvisioningState PROCESSING = fromString("Processing"); + /** Static value Updating for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState UPDATING = fromString("Updating"); /** Static value Succeeded for DeploymentResourceProvisioningState. */ public static final DeploymentResourceProvisioningState SUCCEEDED = fromString("Succeeded"); diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentResourceStatus.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentResourceStatus.java index 76836afdffb3..80d505648081 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentResourceStatus.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentResourceStatus.java @@ -28,9 +28,6 @@ public final class DeploymentResourceStatus extends ExpandableStringEnum createOrUpdateAsync(String resourceGroupName, String serviceName); + Observable createOrUpdateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource); /** * Operation to delete a Service. @@ -50,10 +52,11 @@ public interface Services { * * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. + * @param resource Parameters for the update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable updateAsync(String resourceGroupName, String serviceName); + Observable updateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource); /** * Regenerate a test key for a Service. diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppPlatformManagementClientImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppPlatformManagementClientImpl.java index 6e5eb0418d75..9c013c2469af 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppPlatformManagementClientImpl.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppPlatformManagementClientImpl.java @@ -10,6 +10,8 @@ import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; @@ -171,6 +173,32 @@ public BindingsInner bindings() { return this.bindings; } + /** + * The CertificatesInner object to access its operations. + */ + private CertificatesInner certificates; + + /** + * Gets the CertificatesInner object to access its operations. + * @return the CertificatesInner object. + */ + public CertificatesInner certificates() { + return this.certificates; + } + + /** + * The CustomDomainsInner object to access its operations. + */ + private CustomDomainsInner customDomains; + + /** + * Gets the CustomDomainsInner object to access its operations. + * @return the CustomDomainsInner object. + */ + public CustomDomainsInner customDomains() { + return this.customDomains; + } + /** * The DeploymentsInner object to access its operations. */ @@ -235,6 +263,8 @@ protected void initialize() { this.services = new ServicesInner(restClient().retrofit(), this); this.apps = new AppsInner(restClient().retrofit(), this); this.bindings = new BindingsInner(restClient().retrofit(), this); + this.certificates = new CertificatesInner(restClient().retrofit(), this); + this.customDomains = new CustomDomainsInner(restClient().retrofit(), this); this.deployments = new DeploymentsInner(restClient().retrofit(), this); this.operations = new OperationsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppPlatformManager.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppPlatformManager.java index 1f61fedfc108..8e248b16829c 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppPlatformManager.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppPlatformManager.java @@ -19,6 +19,8 @@ import com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services; import com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps; import com.microsoft.azure.management.appplatform.v2019_05_01_preview.Bindings; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.Certificates; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomains; import com.microsoft.azure.management.appplatform.v2019_05_01_preview.Deployments; import com.microsoft.azure.management.appplatform.v2019_05_01_preview.Operations; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; @@ -31,6 +33,8 @@ public final class AppPlatformManager extends ManagerCore implements AppResource, AppResource.Definition, AppResource.Update { private String resourceGroupName; private String serviceName; private String appName; - private AppResourceProperties cproperties; - private AppResourceProperties uproperties; private final AppPlatformManager manager; AppResourceImpl(String name, AppPlatformManager manager) { @@ -30,8 +26,6 @@ class AppResourceImpl extends CreatableUpdatableImpl createResourceAsync() { AppsInner client = this.manager().inner().apps(); - return client.createOrUpdateAsync(this.resourceGroupName, this.serviceName, this.appName, this.cproperties) - .map(new Func1() { - @Override - public AppResourceInner call(AppResourceInner resource) { - resetCreateUpdateParameters(); - return resource; - } - }) + return client.createOrUpdateAsync(this.resourceGroupName, this.serviceName, this.appName, this.inner()) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { AppsInner client = this.manager().inner().apps(); - return client.updateAsync(this.resourceGroupName, this.serviceName, this.appName, this.uproperties) - .map(new Func1() { - @Override - public AppResourceInner call(AppResourceInner resource) { - resetCreateUpdateParameters(); - return resource; - } - }) + return client.updateAsync(this.resourceGroupName, this.serviceName, this.appName, this.inner()) .map(innerToFluentMap(this)); } @@ -92,16 +70,17 @@ public boolean isInCreateMode() { return this.inner().id() == null; } - private void resetCreateUpdateParameters() { - this.cproperties = new AppResourceProperties(); - this.uproperties = new AppResourceProperties(); - } @Override public String id() { return this.inner().id(); } + @Override + public String location() { + return this.inner().location(); + } + @Override public String name() { return this.inner().name(); @@ -129,13 +108,15 @@ public AppResourceImpl withServiceName(String serviceName) { return this; } + @Override + public AppResourceImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + @Override public AppResourceImpl withProperties(AppResourceProperties properties) { - if (isInCreateMode()) { - this.cproperties = properties; - } else { - this.uproperties = properties; - } + this.inner().withProperties(properties); return this; } diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppResourceInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppResourceInner.java index ff55fc32e1d9..673074e37c0b 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppResourceInner.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppResourceInner.java @@ -22,6 +22,13 @@ public class AppResourceInner extends ProxyResource { @JsonProperty(value = "properties") private AppResourceProperties properties; + /** + * The GEO location of the application, always the same with its parent + * resource. + */ + @JsonProperty(value = "location") + private String location; + /** * Get properties of the App resource. * @@ -42,4 +49,24 @@ public AppResourceInner withProperties(AppResourceProperties properties) { return this; } + /** + * Get the GEO location of the application, always the same with its parent resource. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the GEO location of the application, always the same with its parent resource. + * + * @param location the location value to set + * @return the AppResourceInner object itself. + */ + public AppResourceInner withLocation(String location) { + this.location = location; + return this; + } + } diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppsInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppsInner.java index 70e18cc35be9..aaeaf61a47d3 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppsInner.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppsInner.java @@ -13,7 +13,6 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.appplatform.v2019_05_01_preview.AppResourceProperties; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -66,11 +65,15 @@ public AppsInner(Retrofit retrofit, AppPlatformManagementClientImpl client) { interface AppsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps get" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("syncStatus") String syncStatus, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Query("syncStatus") String syncStatus, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}") - Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AppResourceInner appResource, @Header("User-Agent") String userAgent); + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Body AppResourceInner appResource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Body AppResourceInner appResource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", method = "DELETE", hasBody = true) @@ -78,7 +81,11 @@ interface AppsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AppResourceInner appResource, @Header("User-Agent") String userAgent); + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Body AppResourceInner appResource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Body AppResourceInner appResource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps list" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps") @@ -164,7 +171,7 @@ public Observable> getWithServiceResponseAsync throw new IllegalArgumentException("Parameter appName is required and cannot be null."); } final String syncStatus = null; - return service.get(this.client.subscriptionId(), resourceGroupName, serviceName, appName, syncStatus, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.get(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), syncStatus, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -251,7 +258,7 @@ public Observable> getWithServiceResponseAsync if (appName == null) { throw new IllegalArgumentException("Parameter appName is required and cannot be null."); } - return service.get(this.client.subscriptionId(), resourceGroupName, serviceName, appName, syncStatus, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.get(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), syncStatus, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -278,13 +285,14 @@ private ServiceResponse getDelegate(Response res * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AppResourceInner object if successful. */ - public AppResourceInner createOrUpdate(String resourceGroupName, String serviceName, String appName) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName).toBlocking().single().body(); + public AppResourceInner createOrUpdate(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).toBlocking().last().body(); } /** @@ -293,12 +301,13 @@ public AppResourceInner createOrUpdate(String resourceGroupName, String serviceN * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName), serviceCallback); + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource), serviceCallback); } /** @@ -307,11 +316,12 @@ public ServiceFuture createOrUpdateAsync(String resourceGroupN * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AppResourceInner object + * @return the observable for the request */ - public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, String appName) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName).map(new Func1, AppResourceInner>() { + public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).map(new Func1, AppResourceInner>() { @Override public AppResourceInner call(ServiceResponse response) { return response.body(); @@ -325,10 +335,11 @@ public AppResourceInner call(ServiceResponse response) { * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AppResourceInner object + * @return the observable for the request */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -341,21 +352,12 @@ public Observable> createOrUpdateWithServiceRe if (appName == null) { throw new IllegalArgumentException("Parameter appName is required and cannot be null."); } - final AppResourceProperties properties = null; - AppResourceInner appResource = new AppResourceInner(); - appResource.withProperties(null); - return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), this.client.acceptLanguage(), appResource, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createOrUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); + if (appResource == null) { + throw new IllegalArgumentException("Parameter appResource is required and cannot be null."); + } + Validator.validate(appResource); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), appResource, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -364,14 +366,14 @@ public Observable> call(Response * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the create or update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AppResourceInner object if successful. */ - public AppResourceInner createOrUpdate(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, properties).toBlocking().single().body(); + public AppResourceInner beginCreateOrUpdate(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).toBlocking().single().body(); } /** @@ -380,13 +382,13 @@ public AppResourceInner createOrUpdate(String resourceGroupName, String serviceN * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the create or update operation * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, properties), serviceCallback); + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource), serviceCallback); } /** @@ -395,12 +397,12 @@ public ServiceFuture createOrUpdateAsync(String resourceGroupN * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the create or update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AppResourceInner object */ - public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, properties).map(new Func1, AppResourceInner>() { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).map(new Func1, AppResourceInner>() { @Override public AppResourceInner call(ServiceResponse response) { return response.body(); @@ -414,11 +416,11 @@ public AppResourceInner call(ServiceResponse response) { * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the create or update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AppResourceInner object */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -431,18 +433,16 @@ public Observable> createOrUpdateWithServiceRe if (appName == null) { throw new IllegalArgumentException("Parameter appName is required and cannot be null."); } - Validator.validate(properties); - AppResourceInner appResource = null; - if (properties != null) { - appResource = new AppResourceInner(); - appResource.withProperties(properties); + if (appResource == null) { + throw new IllegalArgumentException("Parameter appResource is required and cannot be null."); } - return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), this.client.acceptLanguage(), appResource, this.client.userAgent()) + Validator.validate(appResource); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), appResource, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = createOrUpdateDelegate(response); + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -451,9 +451,10 @@ public Observable> call(Response }); } - private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -554,13 +555,14 @@ private ServiceResponse deleteDelegate(Response response) th * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AppResourceInner object if successful. */ - public AppResourceInner update(String resourceGroupName, String serviceName, String appName) { - return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName).toBlocking().single().body(); + public AppResourceInner update(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).toBlocking().last().body(); } /** @@ -569,12 +571,13 @@ public AppResourceInner update(String resourceGroupName, String serviceName, Str * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the update operation * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture updateAsync(String resourceGroupName, String serviceName, String appName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName, appName), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource), serviceCallback); } /** @@ -583,11 +586,12 @@ public ServiceFuture updateAsync(String resourceGroupName, Str * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the update operation * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AppResourceInner object + * @return the observable for the request */ - public Observable updateAsync(String resourceGroupName, String serviceName, String appName) { - return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName).map(new Func1, AppResourceInner>() { + public Observable updateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).map(new Func1, AppResourceInner>() { @Override public AppResourceInner call(ServiceResponse response) { return response.body(); @@ -601,10 +605,11 @@ public AppResourceInner call(ServiceResponse response) { * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the update operation * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AppResourceInner object + * @return the observable for the request */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -617,21 +622,12 @@ public Observable> updateWithServiceResponseAs if (appName == null) { throw new IllegalArgumentException("Parameter appName is required and cannot be null."); } - final AppResourceProperties properties = null; - AppResourceInner appResource = new AppResourceInner(); - appResource.withProperties(null); - return service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), this.client.acceptLanguage(), appResource, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = updateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); + if (appResource == null) { + throw new IllegalArgumentException("Parameter appResource is required and cannot be null."); + } + Validator.validate(appResource); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), appResource, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -640,14 +636,14 @@ public Observable> call(Response * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AppResourceInner object if successful. */ - public AppResourceInner update(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties) { - return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, properties).toBlocking().single().body(); + public AppResourceInner beginUpdate(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).toBlocking().single().body(); } /** @@ -656,13 +652,13 @@ public AppResourceInner update(String resourceGroupName, String serviceName, Str * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the update operation * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture updateAsync(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, properties), serviceCallback); + public ServiceFuture beginUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource), serviceCallback); } /** @@ -671,12 +667,12 @@ public ServiceFuture updateAsync(String resourceGroupName, Str * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AppResourceInner object */ - public Observable updateAsync(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties) { - return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, properties).map(new Func1, AppResourceInner>() { + public Observable beginUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).map(new Func1, AppResourceInner>() { @Override public AppResourceInner call(ServiceResponse response) { return response.body(); @@ -690,11 +686,11 @@ public AppResourceInner call(ServiceResponse response) { * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AppResourceInner object */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties) { + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -707,18 +703,16 @@ public Observable> updateWithServiceResponseAs if (appName == null) { throw new IllegalArgumentException("Parameter appName is required and cannot be null."); } - Validator.validate(properties); - AppResourceInner appResource = null; - if (properties != null) { - appResource = new AppResourceInner(); - appResource.withProperties(properties); + if (appResource == null) { + throw new IllegalArgumentException("Parameter appResource is required and cannot be null."); } - return service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), this.client.acceptLanguage(), appResource, this.client.userAgent()) + Validator.validate(appResource); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), appResource, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = updateDelegate(response); + ServiceResponse clientResponse = beginUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -727,9 +721,10 @@ public Observable> call(Response }); } - private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/BindingsInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/BindingsInner.java index eb4453ff46de..36790bb837aa 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/BindingsInner.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/BindingsInner.java @@ -360,11 +360,8 @@ public Observable> createOrUpdateWithServi throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); } Validator.validate(properties); - BindingResourceInner bindingResource = null; - if (properties != null) { - bindingResource = new BindingResourceInner(); - bindingResource.withProperties(properties); - } + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, this.client.apiVersion(), this.client.acceptLanguage(), bindingResource, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -657,11 +654,8 @@ public Observable> updateWithServiceRespon throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); } Validator.validate(properties); - BindingResourceInner bindingResource = null; - if (properties != null) { - bindingResource = new BindingResourceInner(); - bindingResource.withProperties(properties); - } + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); return service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, this.client.apiVersion(), this.client.acceptLanguage(), bindingResource, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificateResourceImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificateResourceImpl.java new file mode 100644 index 000000000000..a2beead127c1 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificateResourceImpl.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CertificateResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CertificateProperties; +import java.util.List; +import rx.functions.Func1; + +class CertificateResourceImpl extends CreatableUpdatableImpl implements CertificateResource, CertificateResource.Definition, CertificateResource.Update { + private String resourceGroupName; + private String serviceName; + private String certificateName; + private CertificateProperties cproperties; + private CertificateProperties uproperties; + private final AppPlatformManager manager; + + CertificateResourceImpl(String name, AppPlatformManager manager) { + super(name, new CertificateResourceInner()); + this.manager = manager; + // Set resource name + this.certificateName = name; + // + this.cproperties = new CertificateProperties(); + this.uproperties = new CertificateProperties(); + } + + CertificateResourceImpl(CertificateResourceInner inner, AppPlatformManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.certificateName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "Spring"); + this.certificateName = IdParsingUtils.getValueFromIdByName(inner.id(), "certificates"); + // set other parameters for create and update + this.cproperties = new CertificateProperties(); + this.uproperties = new CertificateProperties(); + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + CertificatesInner client = this.manager().inner().certificates(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serviceName, this.certificateName, this.cproperties) + .map(new Func1() { + @Override + public CertificateResourceInner call(CertificateResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + CertificatesInner client = this.manager().inner().certificates(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serviceName, this.certificateName, this.uproperties) + .map(new Func1() { + @Override + public CertificateResourceInner call(CertificateResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + CertificatesInner client = this.manager().inner().certificates(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.cproperties = new CertificateProperties(); + this.uproperties = new CertificateProperties(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public CertificateProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public CertificateResourceImpl withResourceGroupName(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + @Override + public CertificateResourceImpl withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + @Override + public CertificateResourceImpl withProperties(CertificateProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificateResourceInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificateResourceInner.java new file mode 100644 index 000000000000..615eb989f4ae --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificateResourceInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CertificateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * Certificate resource payload. + */ +public class CertificateResourceInner extends ProxyResource { + /** + * Properties of the certificate resource payload. + */ + @JsonProperty(value = "properties") + private CertificateProperties properties; + + /** + * Get properties of the certificate resource payload. + * + * @return the properties value + */ + public CertificateProperties properties() { + return this.properties; + } + + /** + * Set properties of the certificate resource payload. + * + * @param properties the properties value to set + * @return the CertificateResourceInner object itself. + */ + public CertificateResourceInner withProperties(CertificateProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificatesImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificatesImpl.java new file mode 100644 index 000000000000..13ed34edee04 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificatesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * jkl + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.Certificates; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CertificateResource; + +class CertificatesImpl extends WrapperImpl implements Certificates { + private final AppPlatformManager manager; + + CertificatesImpl(AppPlatformManager manager) { + super(manager.inner().certificates()); + this.manager = manager; + } + + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public CertificateResourceImpl define(String name) { + return wrapModel(name); + } + + private CertificateResourceImpl wrapModel(CertificateResourceInner inner) { + return new CertificateResourceImpl(inner, manager()); + } + + private CertificateResourceImpl wrapModel(String name) { + return new CertificateResourceImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String serviceName, String certificateName) { + CertificatesInner client = this.inner(); + return client.getAsync(resourceGroupName, serviceName, certificateName) + .map(new Func1() { + @Override + public CertificateResource call(CertificateResourceInner inner) { + return new CertificateResourceImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serviceName, String certificateName) { + CertificatesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serviceName, certificateName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String serviceName) { + CertificatesInner client = this.inner(); + return client.listAsync(resourceGroupName, serviceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public CertificateResource call(CertificateResourceInner inner) { + return new CertificateResourceImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificatesInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificatesInner.java new file mode 100644 index 000000000000..8679442b3c96 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CertificatesInner.java @@ -0,0 +1,681 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CertificateProperties; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Certificates. + */ +public class CertificatesInner { + /** The Retrofit service to perform REST calls. */ + private CertificatesService service; + /** The service client containing this operation class. */ + private AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of CertificatesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CertificatesInner(Retrofit retrofit, AppPlatformManagementClientImpl client) { + this.service = retrofit.create(CertificatesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Certificates to be + * used by Retrofit to perform actually REST calls. + */ + interface CertificatesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Certificates get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("certificateName") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Certificates createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("certificateName") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CertificateResourceInner certificateResource, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Certificates delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("certificateName") String certificateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Certificates list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Certificates listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateResourceInner object if successful. + */ + public CertificateResourceInner get(String resourceGroupName, String serviceName, String certificateName) { + return getWithServiceResponseAsync(resourceGroupName, serviceName, certificateName).toBlocking().single().body(); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serviceName, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serviceName, certificateName), serviceCallback); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateResourceInner object + */ + public Observable getAsync(String resourceGroupName, String serviceName, String certificateName) { + return getWithServiceResponseAsync(resourceGroupName, serviceName, certificateName).map(new Func1, CertificateResourceInner>() { + @Override + public CertificateResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serviceName, String certificateName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serviceName, certificateName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateResourceInner object if successful. + */ + public CertificateResourceInner createOrUpdate(String resourceGroupName, String serviceName, String certificateName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, certificateName).toBlocking().single().body(); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceName, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, certificateName), serviceCallback); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, String certificateName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, certificateName).map(new Func1, CertificateResourceInner>() { + @Override + public CertificateResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String certificateName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + final CertificateProperties properties = null; + CertificateResourceInner certificateResource = new CertificateResourceInner(); + certificateResource.withProperties(null); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, certificateName, this.client.apiVersion(), this.client.acceptLanguage(), certificateResource, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Properties of the certificate resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateResourceInner object if successful. + */ + public CertificateResourceInner createOrUpdate(String resourceGroupName, String serviceName, String certificateName, CertificateProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, certificateName, properties).toBlocking().single().body(); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Properties of the certificate resource payload. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceName, String certificateName, CertificateProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, certificateName, properties), serviceCallback); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Properties of the certificate resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, String certificateName, CertificateProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, certificateName, properties).map(new Func1, CertificateResourceInner>() { + @Override + public CertificateResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Properties of the certificate resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String certificateName, CertificateProperties properties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + Validator.validate(properties); + CertificateResourceInner certificateResource = new CertificateResourceInner(); + certificateResource.withProperties(properties); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, certificateName, this.client.apiVersion(), this.client.acceptLanguage(), certificateResource, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String serviceName, String certificateName) { + deleteWithServiceResponseAsync(resourceGroupName, serviceName, certificateName).toBlocking().single().body(); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String serviceName, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceName, certificateName), serviceCallback); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String serviceName, String certificateName) { + return deleteWithServiceResponseAsync(resourceGroupName, serviceName, certificateName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serviceName, String certificateName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, serviceName, certificateName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateResourceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String serviceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, serviceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String serviceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, serviceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateResourceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String serviceName) { + return listWithServiceResponseAsync(resourceGroupName, serviceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String serviceName) { + return listSinglePageAsync(resourceGroupName, serviceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the certificates of one user. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + ServiceResponse> * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CertificateResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String serviceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the certificates of one user. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CertificateResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the certificates of one user. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the certificates of one user. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the certificates of one user. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the certificates of one user. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CertificateResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainResourceImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainResourceImpl.java new file mode 100644 index 000000000000..058a49842aa2 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainResourceImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomainResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomainProperties; +import rx.functions.Func1; + +class CustomDomainResourceImpl extends CreatableUpdatableImpl implements CustomDomainResource, CustomDomainResource.Definition, CustomDomainResource.Update { + private final AppPlatformManager manager; + private String resourceGroupName; + private String serviceName; + private String appName; + private String domainName; + private CustomDomainProperties cproperties; + private CustomDomainProperties uproperties; + + CustomDomainResourceImpl(String name, AppPlatformManager manager) { + super(name, new CustomDomainResourceInner()); + this.manager = manager; + // Set resource name + this.domainName = name; + // + this.cproperties = new CustomDomainProperties(); + this.uproperties = new CustomDomainProperties(); + } + + CustomDomainResourceImpl(CustomDomainResourceInner inner, AppPlatformManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.domainName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "Spring"); + this.appName = IdParsingUtils.getValueFromIdByName(inner.id(), "apps"); + this.domainName = IdParsingUtils.getValueFromIdByName(inner.id(), "domains"); + // + this.cproperties = new CustomDomainProperties(); + this.uproperties = new CustomDomainProperties(); + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + CustomDomainsInner client = this.manager().inner().customDomains(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serviceName, this.appName, this.domainName, this.cproperties) + .map(new Func1() { + @Override + public CustomDomainResourceInner call(CustomDomainResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + CustomDomainsInner client = this.manager().inner().customDomains(); + return client.patchAsync(this.resourceGroupName, this.serviceName, this.appName, this.domainName, this.uproperties) + .map(new Func1() { + @Override + public CustomDomainResourceInner call(CustomDomainResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + CustomDomainsInner client = this.manager().inner().customDomains(); + return client.getAsync(this.resourceGroupName, this.serviceName, this.appName, this.domainName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.cproperties = new CustomDomainProperties(); + this.uproperties = new CustomDomainProperties(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public CustomDomainProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public CustomDomainResourceImpl withExistingApp(String resourceGroupName, String serviceName, String appName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.appName = appName; + return this; + } + + @Override + public CustomDomainResourceImpl withProperties(CustomDomainProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainResourceInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainResourceInner.java new file mode 100644 index 000000000000..89da9d410dfa --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainResourceInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomainProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * Custom domain resource payload. + */ +public class CustomDomainResourceInner extends ProxyResource { + /** + * Properties of the custom domain resource. + */ + @JsonProperty(value = "properties") + private CustomDomainProperties properties; + + /** + * Get properties of the custom domain resource. + * + * @return the properties value + */ + public CustomDomainProperties properties() { + return this.properties; + } + + /** + * Set properties of the custom domain resource. + * + * @param properties the properties value to set + * @return the CustomDomainResourceInner object itself. + */ + public CustomDomainResourceInner withProperties(CustomDomainProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainValidateResultImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainValidateResultImpl.java new file mode 100644 index 000000000000..d08a5a756b0a --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainValidateResultImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomainValidateResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class CustomDomainValidateResultImpl extends WrapperImpl implements CustomDomainValidateResult { + private final AppPlatformManager manager; + CustomDomainValidateResultImpl(CustomDomainValidateResultInner inner, AppPlatformManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public Boolean isValid() { + return this.inner().isValid(); + } + + @Override + public String message() { + return this.inner().message(); + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainValidateResultInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainValidateResultInner.java new file mode 100644 index 000000000000..513103036e2c --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainValidateResultInner.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Validation result for custom domain. + */ +public class CustomDomainValidateResultInner { + /** + * Indicates if domain name is valid. + */ + @JsonProperty(value = "isValid") + private Boolean isValid; + + /** + * Message of why domain name is invalid. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get indicates if domain name is valid. + * + * @return the isValid value + */ + public Boolean isValid() { + return this.isValid; + } + + /** + * Set indicates if domain name is valid. + * + * @param isValid the isValid value to set + * @return the CustomDomainValidateResultInner object itself. + */ + public CustomDomainValidateResultInner withIsValid(Boolean isValid) { + this.isValid = isValid; + return this; + } + + /** + * Get message of why domain name is invalid. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set message of why domain name is invalid. + * + * @param message the message value to set + * @return the CustomDomainValidateResultInner object itself. + */ + public CustomDomainValidateResultInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainsImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainsImpl.java new file mode 100644 index 000000000000..63ca53137d83 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainsImpl.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomains; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomainValidateResult; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomainResource; + +class CustomDomainsImpl extends WrapperImpl implements CustomDomains { + private final AppPlatformManager manager; + + CustomDomainsImpl(AppPlatformManager manager) { + super(manager.inner().customDomains()); + this.manager = manager; + } + + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public CustomDomainResourceImpl define(String name) { + return wrapModel(name); + } + + private CustomDomainResourceImpl wrapModel(CustomDomainResourceInner inner) { + return new CustomDomainResourceImpl(inner, manager()); + } + + private CustomDomainResourceImpl wrapModel(String name) { + return new CustomDomainResourceImpl(name, this.manager()); + } + + @Override + public Observable validateAsync(String resourceGroupName, String serviceName, String appName, String name) { + CustomDomainsInner client = this.inner(); + return client.validateAsync(resourceGroupName, serviceName, appName, name) + .map(new Func1() { + @Override + public CustomDomainValidateResult call(CustomDomainValidateResultInner inner) { + return new CustomDomainValidateResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String serviceName, final String appName) { + CustomDomainsInner client = this.inner(); + return client.listAsync(resourceGroupName, serviceName, appName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public CustomDomainResource call(CustomDomainResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + CustomDomainsInner client = this.inner(); + return client.getAsync(resourceGroupName, serviceName, appName, domainName) + .flatMap(new Func1>() { + @Override + public Observable call(CustomDomainResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((CustomDomainResource)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + CustomDomainsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serviceName, appName, domainName).toCompletable(); + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainsInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainsInner.java new file mode 100644 index 000000000000..7c84f2ed7594 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/CustomDomainsInner.java @@ -0,0 +1,1024 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomainProperties; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomainValidatePayload; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CustomDomains. + */ +public class CustomDomainsInner { + /** The Retrofit service to perform REST calls. */ + private CustomDomainsService service; + /** The service client containing this operation class. */ + private AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of CustomDomainsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CustomDomainsInner(Retrofit retrofit, AppPlatformManagementClientImpl client) { + this.service = retrofit.create(CustomDomainsService.class); + this.client = client; + } + + /** + * The interface defining all the services for CustomDomains to be + * used by Retrofit to perform actually REST calls. + */ + interface CustomDomainsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomains get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomains createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CustomDomainResourceInner domainResource, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomains delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomains patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}") + Observable> patch(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CustomDomainResourceInner domainResource, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomains list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomains validate" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/validate") + Observable> validate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CustomDomainValidatePayload validatePayload, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.CustomDomains listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomDomainResourceInner object if successful. + */ + public CustomDomainResourceInner get(String resourceGroupName, String serviceName, String appName, String domainName) { + return getWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName).toBlocking().single().body(); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serviceName, String appName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName), serviceCallback); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainResourceInner object + */ + public Observable getAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + return getWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName).map(new Func1, CustomDomainResourceInner>() { + @Override + public CustomDomainResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (appName == null) { + throw new IllegalArgumentException("Parameter appName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serviceName, appName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomDomainResourceInner object if successful. + */ + public CustomDomainResourceInner createOrUpdate(String resourceGroupName, String serviceName, String appName, String domainName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName).toBlocking().single().body(); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName), serviceCallback); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName).map(new Func1, CustomDomainResourceInner>() { + @Override + public CustomDomainResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (appName == null) { + throw new IllegalArgumentException("Parameter appName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + final CustomDomainProperties properties = null; + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(null); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainResource, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Properties of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomDomainResourceInner object if successful. + */ + public CustomDomainResourceInner createOrUpdate(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName, properties).toBlocking().single().body(); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Properties of the custom domain resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName, properties), serviceCallback); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Properties of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName, properties).map(new Func1, CustomDomainResourceInner>() { + @Override + public CustomDomainResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Properties of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (appName == null) { + throw new IllegalArgumentException("Parameter appName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + Validator.validate(properties); + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(properties); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainResource, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String serviceName, String appName, String domainName) { + deleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName).toBlocking().single().body(); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String serviceName, String appName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName), serviceCallback); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + return deleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (appName == null) { + throw new IllegalArgumentException("Parameter appName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, serviceName, appName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomDomainResourceInner object if successful. + */ + public CustomDomainResourceInner patch(String resourceGroupName, String serviceName, String appName, String domainName) { + return patchWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName).toBlocking().single().body(); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patchAsync(String resourceGroupName, String serviceName, String appName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName), serviceCallback); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainResourceInner object + */ + public Observable patchAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + return patchWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName).map(new Func1, CustomDomainResourceInner>() { + @Override + public CustomDomainResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainResourceInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (appName == null) { + throw new IllegalArgumentException("Parameter appName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + final CustomDomainProperties properties = null; + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(null); + return service.patch(this.client.subscriptionId(), resourceGroupName, serviceName, appName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainResource, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Properties of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomDomainResourceInner object if successful. + */ + public CustomDomainResourceInner patch(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties) { + return patchWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName, properties).toBlocking().single().body(); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Properties of the custom domain resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patchAsync(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName, properties), serviceCallback); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Properties of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainResourceInner object + */ + public Observable patchAsync(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties) { + return patchWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName, properties).map(new Func1, CustomDomainResourceInner>() { + @Override + public CustomDomainResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Properties of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainResourceInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (appName == null) { + throw new IllegalArgumentException("Parameter appName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + Validator.validate(properties); + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(properties); + return service.patch(this.client.subscriptionId(), resourceGroupName, serviceName, appName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainResource, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patchDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CustomDomainResourceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String serviceName, final String appName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, serviceName, appName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String serviceName, final String appName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, serviceName, appName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomDomainResourceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String serviceName, final String appName) { + return listWithServiceResponseAsync(resourceGroupName, serviceName, appName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomDomainResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String serviceName, final String appName) { + return listSinglePageAsync(resourceGroupName, serviceName, appName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the custom domains of one lifecycle application. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + ServiceResponse> * @param serviceName The name of the Service resource. + ServiceResponse> * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CustomDomainResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String serviceName, final String appName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (appName == null) { + throw new IllegalArgumentException("Parameter appName is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomDomainValidateResultInner object if successful. + */ + public CustomDomainValidateResultInner validate(String resourceGroupName, String serviceName, String appName, String name) { + return validateWithServiceResponseAsync(resourceGroupName, serviceName, appName, name).toBlocking().single().body(); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture validateAsync(String resourceGroupName, String serviceName, String appName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateWithServiceResponseAsync(resourceGroupName, serviceName, appName, name), serviceCallback); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainValidateResultInner object + */ + public Observable validateAsync(String resourceGroupName, String serviceName, String appName, String name) { + return validateWithServiceResponseAsync(resourceGroupName, serviceName, appName, name).map(new Func1, CustomDomainValidateResultInner>() { + @Override + public CustomDomainValidateResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainValidateResultInner object + */ + public Observable> validateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (appName == null) { + throw new IllegalArgumentException("Parameter appName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + CustomDomainValidatePayload validatePayload = new CustomDomainValidatePayload(); + validatePayload.withName(name); + return service.validate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), this.client.acceptLanguage(), validatePayload, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse validateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CustomDomainResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the custom domains of one lifecycle application. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomDomainResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomDomainResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the custom domains of one lifecycle application. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CustomDomainResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/DeploymentsInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/DeploymentsInner.java index cc60083c5c06..c4488fa12457 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/DeploymentsInner.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/DeploymentsInner.java @@ -40,8 +40,6 @@ import rx.Observable; import com.microsoft.azure.LongRunningFinalState; import com.microsoft.azure.LongRunningOperationOptions; -import com.microsoft.azure.LongRunningFinalState; -import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined @@ -95,11 +93,11 @@ interface DeploymentsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Deployments list" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments") - Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("version") String version, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Query("version") String version, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Deployments listClusterAllDeployments" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments") - Observable> listClusterAllDeployments(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("version") String version, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listClusterAllDeployments(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Query("version") String version, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Deployments start" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start") @@ -399,11 +397,8 @@ public Observable> createOrUpdateWithSe throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); } Validator.validate(properties); - DeploymentResourceInner deploymentResource = null; - if (properties != null) { - deploymentResource = new DeploymentResourceInner(); - deploymentResource.withProperties(properties); - } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), deploymentResource, this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -582,11 +577,8 @@ public Observable> beginCreateOrUpdateW throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); } Validator.validate(properties); - DeploymentResourceInner deploymentResource = null; - if (properties != null) { - deploymentResource = new DeploymentResourceInner(); - deploymentResource.withProperties(properties); - } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), deploymentResource, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -869,11 +861,8 @@ public Observable> updateWithServiceRes throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); } Validator.validate(properties); - DeploymentResourceInner deploymentResource = null; - if (properties != null) { - deploymentResource = new DeploymentResourceInner(); - deploymentResource.withProperties(properties); - } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), deploymentResource, this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -1052,11 +1041,8 @@ public Observable> beginUpdateWithServi throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); } Validator.validate(properties); - DeploymentResourceInner deploymentResource = null; - if (properties != null) { - deploymentResource = new DeploymentResourceInner(); - deploymentResource.withProperties(properties); - } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), deploymentResource, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -1188,7 +1174,7 @@ public Observable>> listSinglePage } final List version = null; String versionConverted = this.client.serializerAdapter().serializeList(version, CollectionFormat.MULTI); - return service.list(this.client.subscriptionId(), resourceGroupName, serviceName, appName, versionConverted, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.list(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), versionConverted, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1316,7 +1302,7 @@ public Observable>> listSinglePage } Validator.validate(version); String versionConverted = this.client.serializerAdapter().serializeList(version, CollectionFormat.MULTI); - return service.list(this.client.subscriptionId(), resourceGroupName, serviceName, appName, versionConverted, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.list(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), versionConverted, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1438,7 +1424,7 @@ public Observable>> listClusterAll } final List version = null; String versionConverted = this.client.serializerAdapter().serializeList(version, CollectionFormat.MULTI); - return service.listClusterAllDeployments(this.client.subscriptionId(), resourceGroupName, serviceName, versionConverted, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.listClusterAllDeployments(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), versionConverted, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1558,7 +1544,7 @@ public Observable>> listClusterAll } Validator.validate(version); String versionConverted = this.client.serializerAdapter().serializeList(version, CollectionFormat.MULTI); - return service.listClusterAllDeployments(this.client.subscriptionId(), resourceGroupName, serviceName, versionConverted, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.listClusterAllDeployments(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), versionConverted, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesImpl.java index 377b9a7f7fdd..8bd1c5bf441c 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesImpl.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesImpl.java @@ -46,9 +46,9 @@ public ServiceResource call(ServiceResourceInner inner) { } @Override - public Observable createOrUpdateAsync(String resourceGroupName, String serviceName) { + public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource) { ServicesInner client = this.inner(); - return client.createOrUpdateAsync(resourceGroupName, serviceName) + return client.createOrUpdateAsync(resourceGroupName, serviceName, resource) .map(new Func1() { @Override public ServiceResource call(ServiceResourceInner inner) { @@ -64,9 +64,9 @@ public Completable deleteAsync(String resourceGroupName, String serviceName) { } @Override - public Observable updateAsync(String resourceGroupName, String serviceName) { + public Observable updateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource) { ServicesInner client = this.inner(); - return client.updateAsync(resourceGroupName, serviceName) + return client.updateAsync(resourceGroupName, serviceName, resource) .map(new Func1() { @Override public ServiceResource call(ServiceResourceInner inner) { diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesInner.java index bb1d14453825..2bd3d9c1d88b 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesInner.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesInner.java @@ -75,11 +75,11 @@ interface ServicesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}") - Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Body ServiceResourceInner resource, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceInner resource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services beginCreateOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}") - Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Body ServiceResourceInner resource, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceInner resource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", method = "DELETE", hasBody = true) @@ -91,11 +91,11 @@ interface ServicesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Body ServiceResourceInner resource, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceInner resource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services beginUpdate" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}") - Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Body ServiceResourceInner resource, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceInner resource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services listTestKeys" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys") @@ -115,7 +115,7 @@ interface ServicesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services checkNameAvailability" }) @POST("subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability") - Observable> checkNameAvailability(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Body NameAvailabilityParameters availabilityParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Body NameAvailabilityParameters availabilityParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring") @@ -218,72 +218,6 @@ private ServiceResponse getByResourceGroupDelegate(Respons .build(response); } - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ServiceResourceInner object if successful. - */ - public ServiceResourceInner createOrUpdate(String resourceGroupName, String serviceName) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().last().body(); - } - - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); - } - - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable createOrUpdateAsync(String resourceGroupName, String serviceName) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ServiceResourceInner>() { - @Override - public ServiceResourceInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (serviceName == null) { - throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); - } - final ServiceResourceInner resource = null; - Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } /** * Create a new Service or update an exiting Service. * @@ -350,88 +284,14 @@ public Observable> createOrUpdateWithServi if (serviceName == null) { throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); } + if (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } Validator.validate(resource); - Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), resource, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ServiceResourceInner object if successful. - */ - public ServiceResourceInner beginCreateOrUpdate(String resourceGroupName, String serviceName) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); - } - - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); - } - - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ServiceResourceInner object - */ - public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceName) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ServiceResourceInner>() { - @Override - public ServiceResourceInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ServiceResourceInner object - */ - public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (serviceName == null) { - throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); - } - final ServiceResourceInner resource = null; - return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - /** * Create a new Service or update an exiting Service. * @@ -498,8 +358,11 @@ public Observable> beginCreateOrUpdateWith if (serviceName == null) { throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); } + if (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } Validator.validate(resource); - return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), resource, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -669,72 +532,6 @@ private ServiceResponse beginDeleteDelegate(Response respons .build(response); } - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ServiceResourceInner object if successful. - */ - public ServiceResourceInner update(String resourceGroupName, String serviceName) { - return updateWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().last().body(); - } - - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture updateAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); - } - - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable updateAsync(String resourceGroupName, String serviceName) { - return updateWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ServiceResourceInner>() { - @Override - public ServiceResourceInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (serviceName == null) { - throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); - } - final ServiceResourceInner resource = null; - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } /** * Operation to update an exiting Service. * @@ -801,88 +598,14 @@ public Observable> updateWithServiceRespon if (serviceName == null) { throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); } + if (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } Validator.validate(resource); - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), resource, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ServiceResourceInner object if successful. - */ - public ServiceResourceInner beginUpdate(String resourceGroupName, String serviceName) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); - } - - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginUpdateAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); - } - - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ServiceResourceInner object - */ - public Observable beginUpdateAsync(String resourceGroupName, String serviceName) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ServiceResourceInner>() { - @Override - public ServiceResourceInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ServiceResourceInner object - */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (serviceName == null) { - throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); - } - final ServiceResourceInner resource = null; - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - /** * Operation to update an exiting Service. * @@ -949,8 +672,11 @@ public Observable> beginUpdateWithServiceR if (serviceName == null) { throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); } + if (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } Validator.validate(resource); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), resource, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1357,17 +1083,17 @@ public NameAvailabilityInner call(ServiceResponse respons * @return the observable to the NameAvailabilityInner object */ public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, NameAvailabilityParameters availabilityParameters) { - if (location == null) { - throw new IllegalArgumentException("Parameter location is required and cannot be null."); - } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } if (availabilityParameters == null) { throw new IllegalArgumentException("Parameter availabilityParameters is required and cannot be null."); } Validator.validate(availabilityParameters); - return service.checkNameAvailability(location, this.client.subscriptionId(), availabilityParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.checkNameAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), availabilityParameters, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { From 452ea5d650673381c0a84663e41cabab01cd59f2 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Wed, 22 Apr 2020 12:20:05 +0000 Subject: [PATCH 2/2] Generated from 9f2e9aceac18d58c4aae4448c8530b2596396119 Update status and fix one property name. Signed-off-by: Pan Li --- .../v2019_05_01_preview/OperationDetail.java | 8 ++++---- .../implementation/OperationDetailImpl.java | 8 ++++---- .../implementation/OperationDetailInner.java | 16 ++++++++-------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/OperationDetail.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/OperationDetail.java index 15519bb4431b..666de4d4105d 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/OperationDetail.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/OperationDetail.java @@ -18,14 +18,14 @@ */ public interface OperationDetail extends HasInner, HasManager { /** - * @return the dataAction value. + * @return the display value. */ - Boolean dataAction(); + OperationDisplay display(); /** - * @return the display value. + * @return the isDataAction value. */ - OperationDisplay display(); + Boolean isDataAction(); /** * @return the name value. diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/OperationDetailImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/OperationDetailImpl.java index 3990250985bb..98e92521a6e3 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/OperationDetailImpl.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/OperationDetailImpl.java @@ -26,13 +26,13 @@ public AppPlatformManager manager() { } @Override - public Boolean dataAction() { - return this.inner().dataAction(); + public OperationDisplay display() { + return this.inner().display(); } @Override - public OperationDisplay display() { - return this.inner().display(); + public Boolean isDataAction() { + return this.inner().isDataAction(); } @Override diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/OperationDetailInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/OperationDetailInner.java index 5ec2826dab08..5ba51b6a40c1 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/OperationDetailInner.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/OperationDetailInner.java @@ -25,8 +25,8 @@ public class OperationDetailInner { /** * Indicates whether the operation is a data action. */ - @JsonProperty(value = "dataAction") - private Boolean dataAction; + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; /** * Display of the operation. @@ -69,20 +69,20 @@ public OperationDetailInner withName(String name) { /** * Get indicates whether the operation is a data action. * - * @return the dataAction value + * @return the isDataAction value */ - public Boolean dataAction() { - return this.dataAction; + public Boolean isDataAction() { + return this.isDataAction; } /** * Set indicates whether the operation is a data action. * - * @param dataAction the dataAction value to set + * @param isDataAction the isDataAction value to set * @return the OperationDetailInner object itself. */ - public OperationDetailInner withDataAction(Boolean dataAction) { - this.dataAction = dataAction; + public OperationDetailInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; return this; }