From e820abc3a7643669ecf1882a7fd3c20108c3ef57 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 7 Sep 2020 03:23:14 +0000 Subject: [PATCH] Generated from 30c61d8afc9a5c1cc6e5b4a553811171a01352a9 Update samples --- .../mgmt-v2019_05_01_preview/pom.xml | 6 +- .../v2019_05_01_preview/AppResource.java | 77 +- .../AppResourceProperties.java | 56 +- .../AppResourceProvisioningState.java | 6 + .../AvailableRuntimeVersions.java | 26 + .../BindingResourceProperties.java | 26 +- .../CertificateProperties.java | 201 ++++ .../CertificateResource.java | 128 +++ .../v2019_05_01_preview/Certificates.java | 53 + .../ClusterResourceProperties.java | 26 + .../CustomDomainProperties.java | 84 ++ .../CustomDomainResource.java | 118 ++ .../CustomDomainValidatePayload.java | 43 + .../CustomDomainValidateResult.java | 30 + .../v2019_05_01_preview/CustomDomains.java | 68 ++ .../DeploymentInstance.java | 15 + .../DeploymentResourceProperties.java | 9 +- .../DeploymentResourceProvisioningState.java | 4 +- .../DeploymentResourceStatus.java | 3 - .../DeploymentSettings.java | 54 +- .../ManagedIdentityProperties.java | 96 ++ .../ManagedIdentityType.java | 47 + .../v2019_05_01_preview/NetworkProfile.java | 166 +++ .../NetworkProfileOutboundIPs.java | 33 + .../v2019_05_01_preview/OperationDetail.java | 8 +- .../v2019_05_01_preview/ResourceSku.java | 56 + .../ResourceSkuCapabilities.java | 69 ++ .../ResourceSkuLocationInfo.java | 96 ++ .../ResourceSkuRestrictionInfo.java | 70 ++ .../ResourceSkuRestrictions.java | 127 ++ .../ResourceSkuRestrictionsReasonCode.java | 41 + .../ResourceSkuRestrictionsType.java | 41 + .../ResourceSkuZoneDetails.java | 76 ++ .../v2019_05_01_preview/RuntimeVersion.java | 3 + .../v2019_05_01_preview/RuntimeVersions.java | 27 + .../v2019_05_01_preview/ServiceResource.java | 6 + .../v2019_05_01_preview/Services.java | 7 +- .../v2019_05_01_preview/SkuCapacity.java | 122 ++ .../v2019_05_01_preview/SkuScaleType.java | 44 + .../appplatform/v2019_05_01_preview/Skus.java | 19 + .../SupportedRuntimePlatform.java | 41 + .../SupportedRuntimeVersion.java | 44 + .../SupportedRuntimeVersion1.java | 97 ++ .../v2019_05_01_preview/UserSourceInfo.java | 7 +- .../v2019_05_01_preview/UserSourceType.java | 3 + .../AppPlatformManagementClientImpl.java | 58 + .../implementation/AppPlatformManager.java | 48 + .../implementation/AppResourceImpl.java | 59 +- .../implementation/AppResourceInner.java | 54 + .../implementation/AppsInner.java | 179 ++- .../AvailableRuntimeVersionsImpl.java | 33 + .../AvailableRuntimeVersionsInner.java | 34 + .../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/OperationDetailImpl.java | 8 +- .../implementation/OperationDetailInner.java | 16 +- .../implementation/ResourceSkuImpl.java | 70 ++ .../implementation/ResourceSkuInner.java | 207 ++++ .../implementation/RuntimeVersionsImpl.java | 42 + .../implementation/RuntimeVersionsInner.java | 125 ++ .../implementation/ServiceResourceImpl.java | 5 + .../implementation/ServiceResourceInner.java | 26 + .../implementation/ServicesImpl.java | 8 +- .../implementation/ServicesInner.java | 324 +----- .../implementation/SkuInner.java | 95 ++ .../implementation/SkusImpl.java | 68 ++ .../implementation/SkusInner.java | 274 +++++ 77 files changed, 5979 insertions(+), 548 deletions(-) create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AvailableRuntimeVersions.java 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/ManagedIdentityProperties.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ManagedIdentityType.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/NetworkProfile.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/NetworkProfileOutboundIPs.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSku.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuCapabilities.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuLocationInfo.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictionInfo.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictions.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictionsReasonCode.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictionsType.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuZoneDetails.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/RuntimeVersions.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SkuCapacity.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SkuScaleType.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/Skus.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SupportedRuntimePlatform.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SupportedRuntimeVersion.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SupportedRuntimeVersion1.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AvailableRuntimeVersionsImpl.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AvailableRuntimeVersionsInner.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 create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ResourceSkuImpl.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ResourceSkuInner.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/RuntimeVersionsImpl.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/RuntimeVersionsInner.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/SkuInner.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/SkusImpl.java create mode 100644 sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/SkusInner.java diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/pom.xml b/sdk/appplatform/mgmt-v2019_05_01_preview/pom.xml index b53f0e308112a..6d091c6304efc 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 - ../../parents/azure-arm-parent + 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 e76e0a7f25e09..cc6e4fe8f8187 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,16 @@ public interface AppResource extends HasInner, Indexable, Upda */ String id(); + /** + * @return the identity value. + */ + ManagedIdentityProperties identity(); + + /** + * @return the location value. + */ + String location(); + /** * @return the name value. */ @@ -45,7 +54,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 +88,42 @@ 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 Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The Managed Identity type of the app resource + * @return the next definition stage + */ + WithCreate withIdentity(ManagedIdentityProperties identity); + } + + /** + * 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 +132,43 @@ 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.WithIdentity, 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.WithIdentity, UpdateStages.WithLocation, UpdateStages.WithProperties { } /** * Grouping of AppResource update stages. */ interface UpdateStages { + /** + * The stage of the appresource update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The Managed Identity type of the app resource + * @return the next update stage + */ + Update withIdentity(ManagedIdentityProperties identity); + } + + /** + * 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 272ff8751b6c1..f3109cec6bb54 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 75583dfa840cb..5de11d53fd2d8 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, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/BindingResourceProperties.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/BindingResourceProperties.java index b0444be0fc4a3..20c9e30779baa 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/BindingResourceProperties.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/BindingResourceProperties.java @@ -18,13 +18,13 @@ public class BindingResourceProperties { /** * The name of the bound resource. */ - @JsonProperty(value = "resourceName") + @JsonProperty(value = "resourceName", access = JsonProperty.Access.WRITE_ONLY) private String resourceName; /** * The standard Azure resource type of the bound resource. */ - @JsonProperty(value = "resourceType") + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) private String resourceType; /** @@ -73,17 +73,6 @@ public String resourceName() { return this.resourceName; } - /** - * Set the name of the bound resource. - * - * @param resourceName the resourceName value to set - * @return the BindingResourceProperties object itself. - */ - public BindingResourceProperties withResourceName(String resourceName) { - this.resourceName = resourceName; - return this; - } - /** * Get the standard Azure resource type of the bound resource. * @@ -93,17 +82,6 @@ public String resourceType() { return this.resourceType; } - /** - * Set the standard Azure resource type of the bound resource. - * - * @param resourceType the resourceType value to set - * @return the BindingResourceProperties object itself. - */ - public BindingResourceProperties withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - /** * Get the Azure resource id of the bound resource. * diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CertificateProperties.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CertificateProperties.java new file mode 100644 index 0000000000000..4a457e19e52c8 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/CertificateProperties.java @@ -0,0 +1,201 @@ +/** + * 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 java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Certificate resource payload. + */ +public class CertificateProperties { + /** + * The thumbprint of certificate. + */ + @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String thumbprint; + + /** + * The vault uri of user key vault. + */ + @JsonProperty(value = "vaultUri", required = true) + private String vaultUri; + + /** + * The certificate name of key vault. + */ + @JsonProperty(value = "keyVaultCertName", required = true) + private String keyVaultCertName; + + /** + * The certificate version of key vault. + */ + @JsonProperty(value = "certVersion") + private String certVersion; + + /** + * The issuer of certificate. + */ + @JsonProperty(value = "issuer", access = JsonProperty.Access.WRITE_ONLY) + private String issuer; + + /** + * The issue date of certificate. + */ + @JsonProperty(value = "issuedDate", access = JsonProperty.Access.WRITE_ONLY) + private String issuedDate; + + /** + * The expiration date of certificate. + */ + @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) + private String expirationDate; + + /** + * The activate date of certificate. + */ + @JsonProperty(value = "activateDate", access = JsonProperty.Access.WRITE_ONLY) + private String activateDate; + + /** + * The subject name of certificate. + */ + @JsonProperty(value = "subjectName", access = JsonProperty.Access.WRITE_ONLY) + private String subjectName; + + /** + * The domain list of certificate. + */ + @JsonProperty(value = "dnsNames", access = JsonProperty.Access.WRITE_ONLY) + private List 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 0000000000000..acaf1218f0361 --- /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 0000000000000..75297d48ed821 --- /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/ClusterResourceProperties.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ClusterResourceProperties.java index c8651a77a9f48..b6a892cb8edac 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ClusterResourceProperties.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ClusterResourceProperties.java @@ -34,6 +34,12 @@ public class ClusterResourceProperties { @JsonProperty(value = "trace") private TraceProperties trace; + /** + * Network profile of the Service. + */ + @JsonProperty(value = "networkProfile") + private NetworkProfile networkProfile; + /** * Version of the Service. */ @@ -95,6 +101,26 @@ public ClusterResourceProperties withTrace(TraceProperties trace) { return this; } + /** + * Get network profile of the Service. + * + * @return the networkProfile value + */ + public NetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set network profile of the Service. + * + * @param networkProfile the networkProfile value to set + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withNetworkProfile(NetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + /** * Get version of the Service. * 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 0000000000000..aac3f9c4ce3c7 --- /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,84 @@ +/** + * 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", access = JsonProperty.Access.WRITE_ONLY) + 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; + } + + /** + * 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 0000000000000..4cf4c58ec2db1 --- /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 0000000000000..3d98677bea07e --- /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 0000000000000..137363c10fed1 --- /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 0000000000000..36efdfb65c062 --- /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/DeploymentInstance.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentInstance.java index 8939e95ee9957..f97d1081334b7 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentInstance.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/DeploymentInstance.java @@ -38,6 +38,12 @@ public class DeploymentInstance { @JsonProperty(value = "discoveryStatus", access = JsonProperty.Access.WRITE_ONLY) private String discoveryStatus; + /** + * Start time of the deployment instance. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private String startTime; + /** * Get name of the deployment instance. * @@ -74,4 +80,13 @@ public String discoveryStatus() { return this.discoveryStatus; } + /** + * Get start time of the deployment instance. + * + * @return the startTime value + */ + public String startTime() { + return this.startTime; + } + } 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 b042e3fa267b6..973da0e96f5ee 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 f4e3ef7942bed..0e694365556a5 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 76836afdffb3f..80d5056480815 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 environmentVariables; /** - * Runtime version. Possible values include: 'Java_8', 'Java_11'. + * Runtime version. Possible values include: 'Java_8', 'Java_11', + * 'NetCore_31'. */ @JsonProperty(value = "runtimeVersion") private RuntimeVersion runtimeVersion; /** - * Get required CPU. + * Get required CPU, basic tier should be 1, standard tier should be in range (1, 4). * * @return the cpu value */ @@ -61,7 +71,7 @@ public Integer cpu() { } /** - * Set required CPU. + * Set required CPU, basic tier should be 1, standard tier should be in range (1, 4). * * @param cpu the cpu value to set * @return the DeploymentSettings object itself. @@ -72,7 +82,7 @@ public DeploymentSettings withCpu(Integer cpu) { } /** - * Get required Memory size in GB. + * Get required Memory size in GB, basic tier should be in range (1, 2), standard tier should be in range (1, 8). * * @return the memoryInGB value */ @@ -81,7 +91,7 @@ public Integer memoryInGB() { } /** - * Set required Memory size in GB. + * Set required Memory size in GB, basic tier should be in range (1, 2), standard tier should be in range (1, 8). * * @param memoryInGB the memoryInGB value to set * @return the DeploymentSettings object itself. @@ -112,7 +122,27 @@ public DeploymentSettings withJvmOptions(String jvmOptions) { } /** - * Get instance count. + * Get the path to the .NET executable relative to zip root. + * + * @return the netCoreMainEntryPath value + */ + public String netCoreMainEntryPath() { + return this.netCoreMainEntryPath; + } + + /** + * Set the path to the .NET executable relative to zip root. + * + * @param netCoreMainEntryPath the netCoreMainEntryPath value to set + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withNetCoreMainEntryPath(String netCoreMainEntryPath) { + this.netCoreMainEntryPath = netCoreMainEntryPath; + return this; + } + + /** + * Get instance count, basic tier should be in range (1, 25), standard tier should be in range (1, 500). * * @return the instanceCount value */ @@ -121,7 +151,7 @@ public Integer instanceCount() { } /** - * Set instance count. + * Set instance count, basic tier should be in range (1, 25), standard tier should be in range (1, 500). * * @param instanceCount the instanceCount value to set * @return the DeploymentSettings object itself. @@ -152,7 +182,7 @@ public DeploymentSettings withEnvironmentVariables(Map environme } /** - * Get runtime version. Possible values include: 'Java_8', 'Java_11'. + * Get runtime version. Possible values include: 'Java_8', 'Java_11', 'NetCore_31'. * * @return the runtimeVersion value */ @@ -161,7 +191,7 @@ public RuntimeVersion runtimeVersion() { } /** - * Set runtime version. Possible values include: 'Java_8', 'Java_11'. + * Set runtime version. Possible values include: 'Java_8', 'Java_11', 'NetCore_31'. * * @param runtimeVersion the runtimeVersion value to set * @return the DeploymentSettings object itself. diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ManagedIdentityProperties.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ManagedIdentityProperties.java new file mode 100644 index 0000000000000..85d61936f8c94 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ManagedIdentityProperties.java @@ -0,0 +1,96 @@ +/** + * 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; + +/** + * Managed identity properties retrieved from ARM request headers. + */ +public class ManagedIdentityProperties { + /** + * Possible values include: 'None', 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned,UserAssigned'. + */ + @JsonProperty(value = "type") + private ManagedIdentityType type; + + /** + * The principalId property. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /** + * The tenantId property. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * Get possible values include: 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned'. + * + * @return the type value + */ + public ManagedIdentityType type() { + return this.type; + } + + /** + * Set possible values include: 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned'. + * + * @param type the type value to set + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withType(ManagedIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the principalId value. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId value. + * + * @param principalId the principalId value to set + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the tenantId value. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId value. + * + * @param tenantId the tenantId value to set + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ManagedIdentityType.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ManagedIdentityType.java new file mode 100644 index 0000000000000..f1d06d7d49ac9 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ManagedIdentityType.java @@ -0,0 +1,47 @@ +/** + * 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 java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ManagedIdentityType. + */ +public final class ManagedIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedIdentityType. */ + public static final ManagedIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned,UserAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates or finds a ManagedIdentityType from its string representation. + * @param name a name to look for + * @return the corresponding ManagedIdentityType + */ + @JsonCreator + public static ManagedIdentityType fromString(String name) { + return fromString(name, ManagedIdentityType.class); + } + + /** + * @return known ManagedIdentityType values + */ + public static Collection values() { + return values(ManagedIdentityType.class); + } +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/NetworkProfile.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/NetworkProfile.java new file mode 100644 index 0000000000000..a98a72b73bc34 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/NetworkProfile.java @@ -0,0 +1,166 @@ +/** + * 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; + +/** + * Service network profile payload. + */ +public class NetworkProfile { + /** + * Fully qualified resource Id of the subnet to host Azure Spring Cloud + * Service Runtime. + */ + @JsonProperty(value = "serviceRuntimeSubnetId") + private String serviceRuntimeSubnetId; + + /** + * Fully qualified resource Id of the subnet to host Azure Spring Cloud + * Apps. + */ + @JsonProperty(value = "appSubnetId") + private String appSubnetId; + + /** + * Azure Spring Cloud service reserved CIDR. + */ + @JsonProperty(value = "serviceCidr") + private String serviceCidr; + + /** + * Name of the resource group containing network resources of Azure Spring + * Cloud Service Runtime. + */ + @JsonProperty(value = "serviceRuntimeNetworkResourceGroup") + private String serviceRuntimeNetworkResourceGroup; + + /** + * Name of the resource group containing network resources of Azure Spring + * Cloud Apps. + */ + @JsonProperty(value = "appNetworkResourceGroup") + private String appNetworkResourceGroup; + + /** + * Desired outbound IP resources for Azure Spring Cloud instance. + */ + @JsonProperty(value = "outboundIPs", access = JsonProperty.Access.WRITE_ONLY) + private NetworkProfileOutboundIPs outboundIPs; + + /** + * Get fully qualified resource Id of the subnet to host Azure Spring Cloud Service Runtime. + * + * @return the serviceRuntimeSubnetId value + */ + public String serviceRuntimeSubnetId() { + return this.serviceRuntimeSubnetId; + } + + /** + * Set fully qualified resource Id of the subnet to host Azure Spring Cloud Service Runtime. + * + * @param serviceRuntimeSubnetId the serviceRuntimeSubnetId value to set + * @return the NetworkProfile object itself. + */ + public NetworkProfile withServiceRuntimeSubnetId(String serviceRuntimeSubnetId) { + this.serviceRuntimeSubnetId = serviceRuntimeSubnetId; + return this; + } + + /** + * Get fully qualified resource Id of the subnet to host Azure Spring Cloud Apps. + * + * @return the appSubnetId value + */ + public String appSubnetId() { + return this.appSubnetId; + } + + /** + * Set fully qualified resource Id of the subnet to host Azure Spring Cloud Apps. + * + * @param appSubnetId the appSubnetId value to set + * @return the NetworkProfile object itself. + */ + public NetworkProfile withAppSubnetId(String appSubnetId) { + this.appSubnetId = appSubnetId; + return this; + } + + /** + * Get azure Spring Cloud service reserved CIDR. + * + * @return the serviceCidr value + */ + public String serviceCidr() { + return this.serviceCidr; + } + + /** + * Set azure Spring Cloud service reserved CIDR. + * + * @param serviceCidr the serviceCidr value to set + * @return the NetworkProfile object itself. + */ + public NetworkProfile withServiceCidr(String serviceCidr) { + this.serviceCidr = serviceCidr; + return this; + } + + /** + * Get name of the resource group containing network resources of Azure Spring Cloud Service Runtime. + * + * @return the serviceRuntimeNetworkResourceGroup value + */ + public String serviceRuntimeNetworkResourceGroup() { + return this.serviceRuntimeNetworkResourceGroup; + } + + /** + * Set name of the resource group containing network resources of Azure Spring Cloud Service Runtime. + * + * @param serviceRuntimeNetworkResourceGroup the serviceRuntimeNetworkResourceGroup value to set + * @return the NetworkProfile object itself. + */ + public NetworkProfile withServiceRuntimeNetworkResourceGroup(String serviceRuntimeNetworkResourceGroup) { + this.serviceRuntimeNetworkResourceGroup = serviceRuntimeNetworkResourceGroup; + return this; + } + + /** + * Get name of the resource group containing network resources of Azure Spring Cloud Apps. + * + * @return the appNetworkResourceGroup value + */ + public String appNetworkResourceGroup() { + return this.appNetworkResourceGroup; + } + + /** + * Set name of the resource group containing network resources of Azure Spring Cloud Apps. + * + * @param appNetworkResourceGroup the appNetworkResourceGroup value to set + * @return the NetworkProfile object itself. + */ + public NetworkProfile withAppNetworkResourceGroup(String appNetworkResourceGroup) { + this.appNetworkResourceGroup = appNetworkResourceGroup; + return this; + } + + /** + * Get desired outbound IP resources for Azure Spring Cloud instance. + * + * @return the outboundIPs value + */ + public NetworkProfileOutboundIPs outboundIPs() { + return this.outboundIPs; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/NetworkProfileOutboundIPs.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/NetworkProfileOutboundIPs.java new file mode 100644 index 0000000000000..bc36d48b1b25a --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/NetworkProfileOutboundIPs.java @@ -0,0 +1,33 @@ +/** + * 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 java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Desired outbound IP resources for Azure Spring Cloud instance. + */ +public class NetworkProfileOutboundIPs { + /** + * A list of public IP addresses. + */ + @JsonProperty(value = "publicIPs", access = JsonProperty.Access.WRITE_ONLY) + private List publicIPs; + + /** + * Get a list of public IP addresses. + * + * @return the publicIPs value + */ + public List publicIPs() { + return this.publicIPs; + } + +} 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 15519bb4431b1..666de4d4105d2 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/ResourceSku.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSku.java new file mode 100644 index 0000000000000..044f4e8c58d10 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSku.java @@ -0,0 +1,56 @@ +/** + * 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.ResourceSkuInner; +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 ResourceSku. + */ +public interface ResourceSku extends HasInner, HasManager { + /** + * @return the capacity value. + */ + SkuCapacity capacity(); + + /** + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * @return the locations value. + */ + List locations(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the restrictions value. + */ + List restrictions(); + + /** + * @return the tier value. + */ + String tier(); + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuCapabilities.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuCapabilities.java new file mode 100644 index 0000000000000..1651491100596 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuCapabilities.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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ResourceSkuCapabilities model. + */ +public class ResourceSkuCapabilities { + /** + * Gets an invariant to describe the feature. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets an invariant if the feature is measured by quantity. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get gets an invariant to describe the feature. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets an invariant to describe the feature. + * + * @param name the name value to set + * @return the ResourceSkuCapabilities object itself. + */ + public ResourceSkuCapabilities withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets an invariant if the feature is measured by quantity. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set gets an invariant if the feature is measured by quantity. + * + * @param value the value value to set + * @return the ResourceSkuCapabilities object itself. + */ + public ResourceSkuCapabilities withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuLocationInfo.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuLocationInfo.java new file mode 100644 index 0000000000000..6fc2e5f8ecca6 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuLocationInfo.java @@ -0,0 +1,96 @@ +/** + * 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 java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ResourceSkuLocationInfo model. + */ +public class ResourceSkuLocationInfo { + /** + * Gets location of the SKU. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Gets list of availability zones where the SKU is supported. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Gets details of capabilities available to a SKU in specific zones. + */ + @JsonProperty(value = "zoneDetails") + private List zoneDetails; + + /** + * Get gets location of the SKU. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets location of the SKU. + * + * @param location the location value to set + * @return the ResourceSkuLocationInfo object itself. + */ + public ResourceSkuLocationInfo withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets list of availability zones where the SKU is supported. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set gets list of availability zones where the SKU is supported. + * + * @param zones the zones value to set + * @return the ResourceSkuLocationInfo object itself. + */ + public ResourceSkuLocationInfo withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get gets details of capabilities available to a SKU in specific zones. + * + * @return the zoneDetails value + */ + public List zoneDetails() { + return this.zoneDetails; + } + + /** + * Set gets details of capabilities available to a SKU in specific zones. + * + * @param zoneDetails the zoneDetails value to set + * @return the ResourceSkuLocationInfo object itself. + */ + public ResourceSkuLocationInfo withZoneDetails(List zoneDetails) { + this.zoneDetails = zoneDetails; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictionInfo.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictionInfo.java new file mode 100644 index 0000000000000..c5a1bf7886488 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictionInfo.java @@ -0,0 +1,70 @@ +/** + * 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 java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ResourceSkuRestrictionInfo model. + */ +public class ResourceSkuRestrictionInfo { + /** + * Gets locations where the SKU is restricted. + */ + @JsonProperty(value = "locations") + private List locations; + + /** + * Gets list of availability zones where the SKU is restricted. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get gets locations where the SKU is restricted. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Set gets locations where the SKU is restricted. + * + * @param locations the locations value to set + * @return the ResourceSkuRestrictionInfo object itself. + */ + public ResourceSkuRestrictionInfo withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get gets list of availability zones where the SKU is restricted. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set gets list of availability zones where the SKU is restricted. + * + * @param zones the zones value to set + * @return the ResourceSkuRestrictionInfo object itself. + */ + public ResourceSkuRestrictionInfo withZones(List zones) { + this.zones = zones; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictions.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictions.java new file mode 100644 index 0000000000000..6b670eecf7d4d --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictions.java @@ -0,0 +1,127 @@ +/** + * 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 java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ResourceSkuRestrictions model. + */ +public class ResourceSkuRestrictions { + /** + * Gets the type of restrictions. Possible values include: 'Location', + * 'Zone'. + */ + @JsonProperty(value = "type") + private ResourceSkuRestrictionsType type; + + /** + * Gets the value of restrictions. If the restriction type is set to + * location. This would be different locations where the SKU is restricted. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Gets the information about the restriction where the SKU cannot be used. + */ + @JsonProperty(value = "restrictionInfo") + private ResourceSkuRestrictionInfo restrictionInfo; + + /** + * Gets the reason for restriction. Possible values include: 'QuotaId', + * 'NotAvailableForSubscription'. + */ + @JsonProperty(value = "reasonCode") + private ResourceSkuRestrictionsReasonCode reasonCode; + + /** + * Get gets the type of restrictions. Possible values include: 'Location', 'Zone'. + * + * @return the type value + */ + public ResourceSkuRestrictionsType type() { + return this.type; + } + + /** + * Set gets the type of restrictions. Possible values include: 'Location', 'Zone'. + * + * @param type the type value to set + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withType(ResourceSkuRestrictionsType type) { + this.type = type; + return this; + } + + /** + * Get gets the value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set gets the value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + * + * @param values the values value to set + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withValues(List values) { + this.values = values; + return this; + } + + /** + * Get gets the information about the restriction where the SKU cannot be used. + * + * @return the restrictionInfo value + */ + public ResourceSkuRestrictionInfo restrictionInfo() { + return this.restrictionInfo; + } + + /** + * Set gets the information about the restriction where the SKU cannot be used. + * + * @param restrictionInfo the restrictionInfo value to set + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withRestrictionInfo(ResourceSkuRestrictionInfo restrictionInfo) { + this.restrictionInfo = restrictionInfo; + return this; + } + + /** + * Get gets the reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + * + * @return the reasonCode value + */ + public ResourceSkuRestrictionsReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Set gets the reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + * + * @param reasonCode the reasonCode value to set + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withReasonCode(ResourceSkuRestrictionsReasonCode reasonCode) { + this.reasonCode = reasonCode; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictionsReasonCode.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictionsReasonCode.java new file mode 100644 index 0000000000000..91cc9232ad1be --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictionsReasonCode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResourceSkuRestrictionsReasonCode. + */ +public final class ResourceSkuRestrictionsReasonCode extends ExpandableStringEnum { + /** Static value QuotaId for ResourceSkuRestrictionsReasonCode. */ + public static final ResourceSkuRestrictionsReasonCode QUOTA_ID = fromString("QuotaId"); + + /** Static value NotAvailableForSubscription for ResourceSkuRestrictionsReasonCode. */ + public static final ResourceSkuRestrictionsReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = fromString("NotAvailableForSubscription"); + + /** + * Creates or finds a ResourceSkuRestrictionsReasonCode from its string representation. + * @param name a name to look for + * @return the corresponding ResourceSkuRestrictionsReasonCode + */ + @JsonCreator + public static ResourceSkuRestrictionsReasonCode fromString(String name) { + return fromString(name, ResourceSkuRestrictionsReasonCode.class); + } + + /** + * @return known ResourceSkuRestrictionsReasonCode values + */ + public static Collection values() { + return values(ResourceSkuRestrictionsReasonCode.class); + } +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictionsType.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictionsType.java new file mode 100644 index 0000000000000..55d17aef3a34e --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuRestrictionsType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResourceSkuRestrictionsType. + */ +public final class ResourceSkuRestrictionsType extends ExpandableStringEnum { + /** Static value Location for ResourceSkuRestrictionsType. */ + public static final ResourceSkuRestrictionsType LOCATION = fromString("Location"); + + /** Static value Zone for ResourceSkuRestrictionsType. */ + public static final ResourceSkuRestrictionsType ZONE = fromString("Zone"); + + /** + * Creates or finds a ResourceSkuRestrictionsType from its string representation. + * @param name a name to look for + * @return the corresponding ResourceSkuRestrictionsType + */ + @JsonCreator + public static ResourceSkuRestrictionsType fromString(String name) { + return fromString(name, ResourceSkuRestrictionsType.class); + } + + /** + * @return known ResourceSkuRestrictionsType values + */ + public static Collection values() { + return values(ResourceSkuRestrictionsType.class); + } +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuZoneDetails.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuZoneDetails.java new file mode 100644 index 0000000000000..7f872feacfa67 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ResourceSkuZoneDetails.java @@ -0,0 +1,76 @@ +/** + * 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 java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ResourceSkuZoneDetails model. + */ +public class ResourceSkuZoneDetails { + /** + * Gets the set of zones that the SKU is available in with the + * specified capabilities. + */ + @JsonProperty(value = "name") + private List name; + + /** + * Gets a list of capabilities that are available for the SKU in the + * specified list of zones. + */ + @JsonProperty(value = "capabilities") + private List capabilities; + + /** + * Get gets the set of zones that the SKU is available in with the + specified capabilities. + * + * @return the name value + */ + public List name() { + return this.name; + } + + /** + * Set gets the set of zones that the SKU is available in with the + specified capabilities. + * + * @param name the name value to set + * @return the ResourceSkuZoneDetails object itself. + */ + public ResourceSkuZoneDetails withName(List name) { + this.name = name; + return this; + } + + /** + * Get gets a list of capabilities that are available for the SKU in the + specified list of zones. + * + * @return the capabilities value + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set gets a list of capabilities that are available for the SKU in the + specified list of zones. + * + * @param capabilities the capabilities value to set + * @return the ResourceSkuZoneDetails object itself. + */ + public ResourceSkuZoneDetails withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/RuntimeVersion.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/RuntimeVersion.java index 1e61bb6363455..55898d4be1444 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/RuntimeVersion.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/RuntimeVersion.java @@ -22,6 +22,9 @@ public final class RuntimeVersion extends ExpandableStringEnum { /** Static value Java_11 for RuntimeVersion. */ public static final RuntimeVersion JAVA_11 = fromString("Java_11"); + /** Static value NetCore_31 for RuntimeVersion. */ + public static final RuntimeVersion NET_CORE_31 = fromString("NetCore_31"); + /** * Creates or finds a RuntimeVersion from its string representation. * @param name a name to look for diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/RuntimeVersions.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/RuntimeVersions.java new file mode 100644 index 0000000000000..16545d46ac0c2 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/RuntimeVersions.java @@ -0,0 +1,27 @@ +/** + * 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 rx.Observable; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.RuntimeVersionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RuntimeVersions. + */ +public interface RuntimeVersions extends HasInner { + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRuntimeVersionsAsync(); + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ServiceResource.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ServiceResource.java index 1b876c03a47ad..782e1a3533333 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ServiceResource.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/ServiceResource.java @@ -12,6 +12,7 @@ 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.ServiceResourceInner; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.SkuInner; import java.util.Map; /** @@ -38,6 +39,11 @@ public interface ServiceResource extends HasInner, HasMana */ ClusterResourceProperties properties(); + /** + * @return the sku value. + */ + SkuInner sku(); + /** * @return the tags value. */ diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/Services.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/Services.java index 9ca007c9f363a..34fbfda6ed9e5 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/Services.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/Services.java @@ -10,6 +10,7 @@ import rx.Completable; import rx.Observable; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.ServiceResourceInner; /** * Type representing Services. @@ -30,10 +31,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 create or update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable 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/SkuCapacity.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SkuCapacity.java new file mode 100644 index 0000000000000..b64aed91a15be --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SkuCapacity.java @@ -0,0 +1,122 @@ +/** + * 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; + +/** + * The SKU capacity. + */ +public class SkuCapacity { + /** + * Gets or sets the minimum. + */ + @JsonProperty(value = "minimum", required = true) + private int minimum; + + /** + * Gets or sets the maximum. + */ + @JsonProperty(value = "maximum") + private Integer maximum; + + /** + * Gets or sets the default. + */ + @JsonProperty(value = "default") + private Integer defaultProperty; + + /** + * Gets or sets the type of the scale. Possible values include: 'None', + * 'Manual', 'Automatic'. + */ + @JsonProperty(value = "scaleType") + private SkuScaleType scaleType; + + /** + * Get gets or sets the minimum. + * + * @return the minimum value + */ + public int minimum() { + return this.minimum; + } + + /** + * Set gets or sets the minimum. + * + * @param minimum the minimum value to set + * @return the SkuCapacity object itself. + */ + public SkuCapacity withMinimum(int minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get gets or sets the maximum. + * + * @return the maximum value + */ + public Integer maximum() { + return this.maximum; + } + + /** + * Set gets or sets the maximum. + * + * @param maximum the maximum value to set + * @return the SkuCapacity object itself. + */ + public SkuCapacity withMaximum(Integer maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get gets or sets the default. + * + * @return the defaultProperty value + */ + public Integer defaultProperty() { + return this.defaultProperty; + } + + /** + * Set gets or sets the default. + * + * @param defaultProperty the defaultProperty value to set + * @return the SkuCapacity object itself. + */ + public SkuCapacity withDefaultProperty(Integer defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Get gets or sets the type of the scale. Possible values include: 'None', 'Manual', 'Automatic'. + * + * @return the scaleType value + */ + public SkuScaleType scaleType() { + return this.scaleType; + } + + /** + * Set gets or sets the type of the scale. Possible values include: 'None', 'Manual', 'Automatic'. + * + * @param scaleType the scaleType value to set + * @return the SkuCapacity object itself. + */ + public SkuCapacity withScaleType(SkuScaleType scaleType) { + this.scaleType = scaleType; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SkuScaleType.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SkuScaleType.java new file mode 100644 index 0000000000000..f7ac91f68316d --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SkuScaleType.java @@ -0,0 +1,44 @@ +/** + * 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 java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuScaleType. + */ +public final class SkuScaleType extends ExpandableStringEnum { + /** Static value None for SkuScaleType. */ + public static final SkuScaleType NONE = fromString("None"); + + /** Static value Manual for SkuScaleType. */ + public static final SkuScaleType MANUAL = fromString("Manual"); + + /** Static value Automatic for SkuScaleType. */ + public static final SkuScaleType AUTOMATIC = fromString("Automatic"); + + /** + * Creates or finds a SkuScaleType from its string representation. + * @param name a name to look for + * @return the corresponding SkuScaleType + */ + @JsonCreator + public static SkuScaleType fromString(String name) { + return fromString(name, SkuScaleType.class); + } + + /** + * @return known SkuScaleType values + */ + public static Collection values() { + return values(SkuScaleType.class); + } +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/Skus.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/Skus.java new file mode 100644 index 0000000000000..7aa1affa082a5 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/Skus.java @@ -0,0 +1,19 @@ +/** + * 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.SupportsListing; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.SkusInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Skus. + */ +public interface Skus extends SupportsListing, HasInner { +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SupportedRuntimePlatform.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SupportedRuntimePlatform.java new file mode 100644 index 0000000000000..77bef26c04e0d --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SupportedRuntimePlatform.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2019_05_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SupportedRuntimePlatform. + */ +public final class SupportedRuntimePlatform extends ExpandableStringEnum { + /** Static value Java for SupportedRuntimePlatform. */ + public static final SupportedRuntimePlatform JAVA = fromString("Java"); + + /** Static value .NET Core for SupportedRuntimePlatform. */ + public static final SupportedRuntimePlatform NET_CORE = fromString(".NET Core"); + + /** + * Creates or finds a SupportedRuntimePlatform from its string representation. + * @param name a name to look for + * @return the corresponding SupportedRuntimePlatform + */ + @JsonCreator + public static SupportedRuntimePlatform fromString(String name) { + return fromString(name, SupportedRuntimePlatform.class); + } + + /** + * @return known SupportedRuntimePlatform values + */ + public static Collection values() { + return values(SupportedRuntimePlatform.class); + } +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SupportedRuntimeVersion.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SupportedRuntimeVersion.java new file mode 100644 index 0000000000000..0b32f8fed3f7e --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SupportedRuntimeVersion.java @@ -0,0 +1,44 @@ +/** + * 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 java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SupportedRuntimeVersion. + */ +public final class SupportedRuntimeVersion extends ExpandableStringEnum { + /** Static value Java_8 for SupportedRuntimeVersion. */ + public static final SupportedRuntimeVersion JAVA_8 = fromString("Java_8"); + + /** Static value Java_11 for SupportedRuntimeVersion. */ + public static final SupportedRuntimeVersion JAVA_11 = fromString("Java_11"); + + /** Static value NetCore_31 for SupportedRuntimeVersion. */ + public static final SupportedRuntimeVersion NET_CORE_31 = fromString("NetCore_31"); + + /** + * Creates or finds a SupportedRuntimeVersion from its string representation. + * @param name a name to look for + * @return the corresponding SupportedRuntimeVersion + */ + @JsonCreator + public static SupportedRuntimeVersion fromString(String name) { + return fromString(name, SupportedRuntimeVersion.class); + } + + /** + * @return known SupportedRuntimeVersion values + */ + public static Collection values() { + return values(SupportedRuntimeVersion.class); + } +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SupportedRuntimeVersion1.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SupportedRuntimeVersion1.java new file mode 100644 index 0000000000000..226fe9be7c524 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/SupportedRuntimeVersion1.java @@ -0,0 +1,97 @@ +/** + * 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; + +/** + * Supported deployment runtime version descriptor. + */ +public class SupportedRuntimeVersion1 { + /** + * The raw value which could be passed to deployment CRUD operations. + * Possible values include: 'Java_8', 'Java_11', 'NetCore_31'. + */ + @JsonProperty(value = "value") + private SupportedRuntimeVersion value; + + /** + * The platform of this runtime version (possible values: "Java" or + * ".NET"). Possible values include: 'Java', '.NET Core'. + */ + @JsonProperty(value = "platform") + private SupportedRuntimePlatform platform; + + /** + * The detailed version (major.minor) of the platform. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the raw value which could be passed to deployment CRUD operations. Possible values include: 'Java_8', 'Java_11', 'NetCore_31'. + * + * @return the value value + */ + public SupportedRuntimeVersion value() { + return this.value; + } + + /** + * Set the raw value which could be passed to deployment CRUD operations. Possible values include: 'Java_8', 'Java_11', 'NetCore_31'. + * + * @param value the value value to set + * @return the SupportedRuntimeVersion1 object itself. + */ + public SupportedRuntimeVersion1 withValue(SupportedRuntimeVersion value) { + this.value = value; + return this; + } + + /** + * Get the platform of this runtime version (possible values: "Java" or ".NET"). Possible values include: 'Java', '.NET Core'. + * + * @return the platform value + */ + public SupportedRuntimePlatform platform() { + return this.platform; + } + + /** + * Set the platform of this runtime version (possible values: "Java" or ".NET"). Possible values include: 'Java', '.NET Core'. + * + * @param platform the platform value to set + * @return the SupportedRuntimeVersion1 object itself. + */ + public SupportedRuntimeVersion1 withPlatform(SupportedRuntimePlatform platform) { + this.platform = platform; + return this; + } + + /** + * Get the detailed version (major.minor) of the platform. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the detailed version (major.minor) of the platform. + * + * @param version the version value to set + * @return the SupportedRuntimeVersion1 object itself. + */ + public SupportedRuntimeVersion1 withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/UserSourceInfo.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/UserSourceInfo.java index d8fc3cef0202a..0abfae43b0b1b 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/UserSourceInfo.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/UserSourceInfo.java @@ -15,7 +15,8 @@ */ public class UserSourceInfo { /** - * Type of the source uploaded. Possible values include: 'Jar', 'Source'. + * Type of the source uploaded. Possible values include: 'Jar', + * 'NetCoreZip', 'Source'. */ @JsonProperty(value = "type") private UserSourceType type; @@ -41,7 +42,7 @@ public class UserSourceInfo { private String artifactSelector; /** - * Get type of the source uploaded. Possible values include: 'Jar', 'Source'. + * Get type of the source uploaded. Possible values include: 'Jar', 'NetCoreZip', 'Source'. * * @return the type value */ @@ -50,7 +51,7 @@ public UserSourceType type() { } /** - * Set type of the source uploaded. Possible values include: 'Jar', 'Source'. + * Set type of the source uploaded. Possible values include: 'Jar', 'NetCoreZip', 'Source'. * * @param type the type value to set * @return the UserSourceInfo object itself. diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/UserSourceType.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/UserSourceType.java index 4008744d7ce00..f920e8184fc2f 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/UserSourceType.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/UserSourceType.java @@ -19,6 +19,9 @@ public final class UserSourceType extends ExpandableStringEnum { /** Static value Jar for UserSourceType. */ public static final UserSourceType JAR = fromString("Jar"); + /** Static value NetCoreZip for UserSourceType. */ + public static final UserSourceType NET_CORE_ZIP = fromString("NetCoreZip"); + /** Static value Source for UserSourceType. */ public static final UserSourceType SOURCE = fromString("Source"); 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 6e5eb0418d755..8513e3a58bbf9 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. */ @@ -197,6 +225,32 @@ public OperationsInner operations() { return this.operations; } + /** + * The RuntimeVersionsInner object to access its operations. + */ + private RuntimeVersionsInner runtimeVersions; + + /** + * Gets the RuntimeVersionsInner object to access its operations. + * @return the RuntimeVersionsInner object. + */ + public RuntimeVersionsInner runtimeVersions() { + return this.runtimeVersions; + } + + /** + * The SkusInner object to access its operations. + */ + private SkusInner skus; + + /** + * Gets the SkusInner object to access its operations. + * @return the SkusInner object. + */ + public SkusInner skus() { + return this.skus; + } + /** * Initializes an instance of AppPlatformManagementClient client. * @@ -235,8 +289,12 @@ 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.runtimeVersions = new RuntimeVersionsInner(restClient().retrofit(), this); + this.skus = new SkusInner(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 1f61fedfc1084..686e4400c87c2 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,8 +19,12 @@ 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.management.appplatform.v2019_05_01_preview.RuntimeVersions; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.Skus; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -31,8 +35,12 @@ 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 +27,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 +71,22 @@ 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 ManagedIdentityProperties identity() { + return this.inner().identity(); + } + + @Override + public String location() { + return this.inner().location(); + } + @Override public String name() { return this.inner().name(); @@ -129,13 +114,21 @@ public AppResourceImpl withServiceName(String serviceName) { return this; } + @Override + public AppResourceImpl withIdentity(ManagedIdentityProperties identity) { + this.inner().withIdentity(identity); + 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 ff55fc32e1d93..0420fdd2e4218 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 @@ -9,6 +9,7 @@ package com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation; import com.microsoft.azure.management.appplatform.v2019_05_01_preview.AppResourceProperties; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.ManagedIdentityProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.azure.ProxyResource; @@ -22,6 +23,19 @@ public class AppResourceInner extends ProxyResource { @JsonProperty(value = "properties") private AppResourceProperties properties; + /** + * The Managed Identity type of the app resource. + */ + @JsonProperty(value = "identity") + private ManagedIdentityProperties identity; + + /** + * 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 +56,44 @@ public AppResourceInner withProperties(AppResourceProperties properties) { return this; } + /** + * Get the Managed Identity type of the app resource. + * + * @return the identity value + */ + public ManagedIdentityProperties identity() { + return this.identity; + } + + /** + * Set the Managed Identity type of the app resource. + * + * @param identity the identity value to set + * @return the AppResourceInner object itself. + */ + public AppResourceInner withIdentity(ManagedIdentityProperties identity) { + this.identity = identity; + 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 70e18cc35be9d..aaeaf61a47d30 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/AvailableRuntimeVersionsImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AvailableRuntimeVersionsImpl.java new file mode 100644 index 0000000000000..f352a6fc56fe8 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AvailableRuntimeVersionsImpl.java @@ -0,0 +1,33 @@ +/** + * 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.AvailableRuntimeVersions; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.SupportedRuntimeVersion1; + +class AvailableRuntimeVersionsImpl extends WrapperImpl implements AvailableRuntimeVersions { + private final AppPlatformManager manager; + AvailableRuntimeVersionsImpl(AvailableRuntimeVersionsInner inner, AppPlatformManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AvailableRuntimeVersionsInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AvailableRuntimeVersionsInner.java new file mode 100644 index 0000000000000..da100457a5bcd --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AvailableRuntimeVersionsInner.java @@ -0,0 +1,34 @@ +/** + * 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 java.util.List; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.SupportedRuntimeVersion1; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The AvailableRuntimeVersionsInner model. + */ +public class AvailableRuntimeVersionsInner { + /** + * A list of all supported runtime versions. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get a list of all supported runtime versions. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} 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 eb4453ff46de3..36790bb837aaf 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 0000000000000..a2beead127c16 --- /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 0000000000000..615eb989f4ae1 --- /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 0000000000000..13ed34edee043 --- /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 0000000000000..8679442b3c962 --- /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 0000000000000..058a49842aa2b --- /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 0000000000000..89da9d410dfac --- /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 0000000000000..d08a5a756b0a5 --- /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 0000000000000..513103036e2c3 --- /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 0000000000000..63ca53137d83d --- /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 0000000000000..7c84f2ed7594f --- /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 cc60083c5c06a..c4488fa124574 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/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 3990250985bb4..98e92521a6e38 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 5ec2826dab08f..5ba51b6a40c17 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; } diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ResourceSkuImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ResourceSkuImpl.java new file mode 100644 index 0000000000000..13163ccac9e35 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ResourceSkuImpl.java @@ -0,0 +1,70 @@ +/** + * 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.ResourceSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.SkuCapacity; +import java.util.List; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.ResourceSkuLocationInfo; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.ResourceSkuRestrictions; + +class ResourceSkuImpl extends WrapperImpl implements ResourceSku { + private final AppPlatformManager manager; + + ResourceSkuImpl(ResourceSkuInner inner, AppPlatformManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + + + @Override + public SkuCapacity capacity() { + return this.inner().capacity(); + } + + @Override + public List locationInfo() { + return this.inner().locationInfo(); + } + + @Override + public List locations() { + return this.inner().locations(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public List restrictions() { + return this.inner().restrictions(); + } + + @Override + public String tier() { + return this.inner().tier(); + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ResourceSkuInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ResourceSkuInner.java new file mode 100644 index 0000000000000..bdb1646c64034 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ResourceSkuInner.java @@ -0,0 +1,207 @@ +/** + * 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.SkuCapacity; +import java.util.List; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.ResourceSkuLocationInfo; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.ResourceSkuRestrictions; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes an available Azure Spring Cloud SKU. + */ +public class ResourceSkuInner { + /** + * Gets the type of resource the SKU applies to. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /** + * Gets the name of SKU. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets the tier of SKU. + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * Gets the capacity of SKU. + */ + @JsonProperty(value = "capacity") + private SkuCapacity capacity; + + /** + * Gets the set of locations that the SKU is available. + */ + @JsonProperty(value = "locations") + private List locations; + + /** + * Gets a list of locations and availability zones in those locations where + * the SKU is available. + */ + @JsonProperty(value = "locationInfo") + private List locationInfo; + + /** + * Gets the restrictions because of which SKU cannot be used. This is + * empty if there are no restrictions. + */ + @JsonProperty(value = "restrictions") + private List restrictions; + + /** + * Get gets the type of resource the SKU applies to. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set gets the type of resource the SKU applies to. + * + * @param resourceType the resourceType value to set + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get gets the name of SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets the name of SKU. + * + * @param name the name value to set + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets the tier of SKU. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set gets the tier of SKU. + * + * @param tier the tier value to set + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get gets the capacity of SKU. + * + * @return the capacity value + */ + public SkuCapacity capacity() { + return this.capacity; + } + + /** + * Set gets the capacity of SKU. + * + * @param capacity the capacity value to set + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withCapacity(SkuCapacity capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get gets the set of locations that the SKU is available. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Set gets the set of locations that the SKU is available. + * + * @param locations the locations value to set + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get gets a list of locations and availability zones in those locations where the SKU is available. + * + * @return the locationInfo value + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Set gets a list of locations and availability zones in those locations where the SKU is available. + * + * @param locationInfo the locationInfo value to set + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withLocationInfo(List locationInfo) { + this.locationInfo = locationInfo; + return this; + } + + /** + * Get gets the restrictions because of which SKU cannot be used. This is + empty if there are no restrictions. + * + * @return the restrictions value + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Set gets the restrictions because of which SKU cannot be used. This is + empty if there are no restrictions. + * + * @param restrictions the restrictions value to set + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withRestrictions(List restrictions) { + this.restrictions = restrictions; + 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/RuntimeVersionsImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/RuntimeVersionsImpl.java new file mode 100644 index 0000000000000..2377fff6dddeb --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/RuntimeVersionsImpl.java @@ -0,0 +1,42 @@ +/** + * 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. + * abc + */ + +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.RuntimeVersions; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.AvailableRuntimeVersions; + +class RuntimeVersionsImpl extends WrapperImpl implements RuntimeVersions { + private final AppPlatformManager manager; + + RuntimeVersionsImpl(AppPlatformManager manager) { + super(manager.inner().runtimeVersions()); + this.manager = manager; + } + + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public Observable listRuntimeVersionsAsync() { + RuntimeVersionsInner client = this.inner(); + return client.listRuntimeVersionsAsync() + .map(new Func1() { + @Override + public AvailableRuntimeVersions call(AvailableRuntimeVersionsInner inner) { + return new AvailableRuntimeVersionsImpl(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/RuntimeVersionsInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/RuntimeVersionsInner.java new file mode 100644 index 0000000000000..8e96f5eceaa3b --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/RuntimeVersionsInner.java @@ -0,0 +1,125 @@ +/** + * 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.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RuntimeVersions. + */ +public class RuntimeVersionsInner { + /** The Retrofit service to perform REST calls. */ + private RuntimeVersionsService service; + /** The service client containing this operation class. */ + private AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of RuntimeVersionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RuntimeVersionsInner(Retrofit retrofit, AppPlatformManagementClientImpl client) { + this.service = retrofit.create(RuntimeVersionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for RuntimeVersions to be + * used by Retrofit to perform actually REST calls. + */ + interface RuntimeVersionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.RuntimeVersions listRuntimeVersions" }) + @GET("providers/Microsoft.AppPlatform/runtimeVersions") + Observable> listRuntimeVersions(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @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 AvailableRuntimeVersionsInner object if successful. + */ + public AvailableRuntimeVersionsInner listRuntimeVersions() { + return listRuntimeVersionsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @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 listRuntimeVersionsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRuntimeVersionsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailableRuntimeVersionsInner object + */ + public Observable listRuntimeVersionsAsync() { + return listRuntimeVersionsWithServiceResponseAsync().map(new Func1, AvailableRuntimeVersionsInner>() { + @Override + public AvailableRuntimeVersionsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailableRuntimeVersionsInner object + */ + public Observable> listRuntimeVersionsWithServiceResponseAsync() { + return service.listRuntimeVersions(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listRuntimeVersionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listRuntimeVersionsDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().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/ServiceResourceImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServiceResourceImpl.java index 2d0e50cfdc448..61a23658730a8 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServiceResourceImpl.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServiceResourceImpl.java @@ -45,6 +45,11 @@ public ClusterResourceProperties properties() { return this.inner().properties(); } + @Override + public SkuInner sku() { + return this.inner().sku(); + } + @Override public Map tags() { return this.inner().getTags(); diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServiceResourceInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServiceResourceInner.java index 3a08888e6533e..6cf55e463ad64 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServiceResourceInner.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServiceResourceInner.java @@ -24,6 +24,12 @@ public class ServiceResourceInner extends Resource { @JsonProperty(value = "properties") private ClusterResourceProperties properties; + /** + * Sku of the Service resource. + */ + @JsonProperty(value = "sku") + private SkuInner sku; + /** * Get properties of the Service resource. * @@ -44,4 +50,24 @@ public ServiceResourceInner withProperties(ClusterResourceProperties properties) return this; } + /** + * Get sku of the Service resource. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Set sku of the Service resource. + * + * @param sku the sku value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withSku(SkuInner sku) { + this.sku = sku; + 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/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 377b9a7f7fdd4..8bd1c5bf441c2 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 bb1d144538255..2bd3d9c1d88b2 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) { diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/SkuInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/SkuInner.java new file mode 100644 index 0000000000000..1b986964e79db --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/SkuInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Sku of Azure Spring Cloud. + */ +public class SkuInner { + /** + * Name of the Sku. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Tier of the Sku. + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * Current capacity of the target resource. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get name of the Sku. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Sku. + * + * @param name the name value to set + * @return the SkuInner object itself. + */ + public SkuInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get tier of the Sku. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set tier of the Sku. + * + * @param tier the tier value to set + * @return the SkuInner object itself. + */ + public SkuInner withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get current capacity of the target resource. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set current capacity of the target resource. + * + * @param capacity the capacity value to set + * @return the SkuInner object itself. + */ + public SkuInner withCapacity(Integer capacity) { + this.capacity = capacity; + 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/SkusImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/SkusImpl.java new file mode 100644 index 0000000000000..72512a289ab82 --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/SkusImpl.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. + * 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.Skus; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.arm.utils.PagedListConverter; +import com.microsoft.azure.management.appplatform.v2019_05_01_preview.ResourceSku; + +class SkusImpl extends WrapperImpl implements Skus { + private PagedListConverter converter; + private final AppPlatformManager manager; + + SkusImpl(AppPlatformManager manager) { + super(manager.inner().skus()); + this.manager = manager; + this.converter = new PagedListConverter() { + @Override + public Observable typeConvertAsync(ResourceSkuInner inner) { + return Observable.just((ResourceSku) wrapModel(inner)); + } + }; + } + + public AppPlatformManager manager() { + return this.manager; + } + + private ResourceSkuImpl wrapModel(ResourceSkuInner inner) { + return new ResourceSkuImpl(inner, manager()); + } + + @Override + public PagedList list() { + SkusInner client = this.inner(); + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + SkusInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ResourceSku call(ResourceSkuInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/SkusInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/SkusInner.java new file mode 100644 index 0000000000000..3b873b4b3e75c --- /dev/null +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/SkusInner.java @@ -0,0 +1,274 @@ +/** + * 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.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +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 Skus. + */ +public class SkusInner { + /** The Retrofit service to perform REST calls. */ + private SkusService service; + /** The service client containing this operation class. */ + private AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of SkusInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SkusInner(Retrofit retrofit, AppPlatformManagementClientImpl client) { + this.service = retrofit.create(SkusService.class); + this.client = client; + } + + /** + * The interface defining all the services for Skus to be + * used by Retrofit to perform actually REST calls. + */ + interface SkusService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Skus list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus") + Observable> list(@Path("subscriptionId") String subscriptionId, @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.Skus listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * + * @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<ResourceSkuInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * + * @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 ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .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)); + } + }); + } + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), 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); + } + + /** + * + * @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<ResourceSkuInner> 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(); + } + }; + } + + /** + * + * @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); + } + + /** + * + * @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<ResourceSkuInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * + * @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<ResourceSkuInner> 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)); + } + }); + } + + /** + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceSkuInner> 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); + } + +}