diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/pom.xml b/sdk/appplatform/mgmt-v2020_11_01_preview/pom.xml new file mode 100644 index 000000000000..e594b209c1de --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.appplatform.v2020_11_01_preview + + com.microsoft.azure + azure-arm-parent + 1.3.2 + ../../parents/azure-arm-parent/pom.xml + + azure-mgmt-appplatform + 1.0.0-beta + jar + Microsoft Azure SDK for AppPlatform Management + This package contains Microsoft AppPlatform Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/AppResource.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/AppResource.java new file mode 100644 index 000000000000..529366e47af5 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/AppResource.java @@ -0,0 +1,185 @@ +/** + * 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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.AppResourceInner; +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.v2020_11_01_preview.implementation.AppPlatformManager; + +/** + * Type representing AppResource. + */ +public interface AppResource extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the identity value. + */ + ManagedIdentityProperties identity(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + AppResourceProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the AppResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroupName, DefinitionStages.WithServiceName, DefinitionStages.WithCreate { + } + + /** + * Grouping of AppResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a AppResource definition. + */ + interface Blank extends WithResourceGroupName { + } + + /** + * The stage of the appresource 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 appresource definition allowing to specify ServiceName. + */ + interface WithServiceName { + /** + * Specifies serviceName. + * @param serviceName The name of the Service resource + * @return the next definition stage + */ + 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 + */ + WithCreate withProperties(AppResourceProperties 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, 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.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. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the App resource + * @return the next update stage + */ + Update withProperties(AppResourceProperties properties); + } + + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/AppResourceProperties.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/AppResourceProperties.java new file mode 100644 index 000000000000..0fa0357b99de --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/AppResourceProperties.java @@ -0,0 +1,220 @@ +/** + * 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.v2020_11_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * App resource properties payload. + */ +public class AppResourceProperties { + /** + * Indicates whether the App exposes public endpoint. + */ + @JsonProperty(value = "public") + private Boolean publicProperty; + + /** + * URL of the App. + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /** + * Provisioning state of the App. Possible values include: 'Succeeded', + * 'Failed', 'Creating', 'Updating'. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AppResourceProvisioningState provisioningState; + + /** + * Name of the active deployment of the App. + */ + @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. + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdTime; + + /** + * Temporary disk settings. + */ + @JsonProperty(value = "temporaryDisk") + private TemporaryDisk temporaryDisk; + + /** + * Persistent disk settings. + */ + @JsonProperty(value = "persistentDisk") + private PersistentDisk persistentDisk; + + /** + * Get indicates whether the App exposes public endpoint. + * + * @return the publicProperty value + */ + public Boolean publicProperty() { + return this.publicProperty; + } + + /** + * Set indicates whether the App exposes public endpoint. + * + * @param publicProperty the publicProperty value to set + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withPublicProperty(Boolean publicProperty) { + this.publicProperty = publicProperty; + return this; + } + + /** + * Get uRL of the App. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Get provisioning state of the App. Possible values include: 'Succeeded', 'Failed', 'Creating', 'Updating'. + * + * @return the provisioningState value + */ + public AppResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get name of the active deployment of the App. + * + * @return the activeDeploymentName value + */ + public String activeDeploymentName() { + return this.activeDeploymentName; + } + + /** + * Set name of the active deployment of the App. + * + * @param activeDeploymentName the activeDeploymentName value to set + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withActiveDeploymentName(String activeDeploymentName) { + this.activeDeploymentName = activeDeploymentName; + 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. + * + * @return the createdTime value + */ + public DateTime createdTime() { + return this.createdTime; + } + + /** + * Get temporary disk settings. + * + * @return the temporaryDisk value + */ + public TemporaryDisk temporaryDisk() { + return this.temporaryDisk; + } + + /** + * Set temporary disk settings. + * + * @param temporaryDisk the temporaryDisk value to set + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withTemporaryDisk(TemporaryDisk temporaryDisk) { + this.temporaryDisk = temporaryDisk; + return this; + } + + /** + * Get persistent disk settings. + * + * @return the persistentDisk value + */ + public PersistentDisk persistentDisk() { + return this.persistentDisk; + } + + /** + * Set persistent disk settings. + * + * @param persistentDisk the persistentDisk value to set + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withPersistentDisk(PersistentDisk persistentDisk) { + this.persistentDisk = persistentDisk; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/AppResourceProvisioningState.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/AppResourceProvisioningState.java new file mode 100644 index 000000000000..d60121e7a065 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/AppResourceProvisioningState.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.v2020_11_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AppResourceProvisioningState. + */ +public final class AppResourceProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState FAILED = fromString("Failed"); + + /** Static value Creating for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a AppResourceProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding AppResourceProvisioningState + */ + @JsonCreator + public static AppResourceProvisioningState fromString(String name) { + return fromString(name, AppResourceProvisioningState.class); + } + + /** + * @return known AppResourceProvisioningState values + */ + public static Collection values() { + return values(AppResourceProvisioningState.class); + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ApplicationInsightsAgentVersions.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ApplicationInsightsAgentVersions.java new file mode 100644 index 000000000000..03df353204ab --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ApplicationInsightsAgentVersions.java @@ -0,0 +1,32 @@ +/** + * 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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application Insights agent versions properties payload. + */ +public class ApplicationInsightsAgentVersions { + /** + * Indicates the version of application insight java agent. + */ + @JsonProperty(value = "java", access = JsonProperty.Access.WRITE_ONLY) + private String java; + + /** + * Get indicates the version of application insight java agent. + * + * @return the java value + */ + public String java() { + return this.java; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Apps.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Apps.java new file mode 100644 index 000000000000..14de3ef706d3 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Apps.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.v2020_11_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.AppsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Apps. + */ +public interface Apps extends SupportsCreating, HasInner { + /** + * Get an App and its properties. + * + * @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 getAsync(String resourceGroupName, String serviceName, String appName); + + /** + * Operation to delete an App. + * + * @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 + */ + Completable deleteAsync(String resourceGroupName, String serviceName, String appName); + + /** + * Handles requests to list all resources in a 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 + */ + Observable listAsync(final String resourceGroupName, final String serviceName); + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @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 getResourceUploadUrlAsync(String resourceGroupName, String serviceName, String appName); + + /** + * 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 validateDomainAsync(String resourceGroupName, String serviceName, String appName, String name); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/AvailableRuntimeVersions.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/AvailableRuntimeVersions.java new file mode 100644 index 000000000000..452d77bb7499 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/AvailableRuntimeVersions.java @@ -0,0 +1,26 @@ +/** + * 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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.AppPlatformManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.AvailableRuntimeVersionsInner; +import java.util.List; + +/** + * Type representing AvailableRuntimeVersions. + */ +public interface AvailableRuntimeVersions extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/BindingResource.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/BindingResource.java new file mode 100644 index 000000000000..5125582816a5 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/BindingResource.java @@ -0,0 +1,119 @@ +/** + * 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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.BindingResourceInner; +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.v2020_11_01_preview.implementation.AppPlatformManager; +import java.util.Map; + +/** + * Type representing BindingResource. + */ +public interface BindingResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + BindingResourceProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the BindingResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithApp, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of BindingResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a BindingResource definition. + */ + interface Blank extends WithApp { + } + + /** + * The stage of the bindingresource 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 bindingresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Binding resource + * @return the next definition stage + */ + WithCreate withProperties(BindingResourceProperties 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 BindingResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties { + } + + /** + * Grouping of BindingResource update stages. + */ + interface UpdateStages { + /** + * The stage of the bindingresource update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Binding resource + * @return the next update stage + */ + Update withProperties(BindingResourceProperties properties); + } + + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/BindingResourceProperties.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/BindingResourceProperties.java new file mode 100644 index 000000000000..6e257e818369 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/BindingResourceProperties.java @@ -0,0 +1,172 @@ +/** + * 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.v2020_11_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Binding resource properties payload. + */ +public class BindingResourceProperties { + /** + * The name of the bound resource. + */ + @JsonProperty(value = "resourceName", access = JsonProperty.Access.WRITE_ONLY) + private String resourceName; + + /** + * The standard Azure resource type of the bound resource. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * The Azure resource id of the bound resource. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * The key of the bound resource. + */ + @JsonProperty(value = "key") + private String key; + + /** + * Binding parameters of the Binding resource. + */ + @JsonProperty(value = "bindingParameters") + private Map bindingParameters; + + /** + * The generated Spring Boot property file for this binding. The secret + * will be deducted. + */ + @JsonProperty(value = "generatedProperties", access = JsonProperty.Access.WRITE_ONLY) + private String generatedProperties; + + /** + * Creation time of the Binding resource. + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private String createdAt; + + /** + * Update time of the Binding resource. + */ + @JsonProperty(value = "updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private String updatedAt; + + /** + * Get the name of the bound resource. + * + * @return the resourceName value + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Get the standard Azure resource type of the bound resource. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the Azure resource id of the bound resource. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the Azure resource id of the bound resource. + * + * @param resourceId the resourceId value to set + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the key of the bound resource. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the key of the bound resource. + * + * @param key the key value to set + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withKey(String key) { + this.key = key; + return this; + } + + /** + * Get binding parameters of the Binding resource. + * + * @return the bindingParameters value + */ + public Map bindingParameters() { + return this.bindingParameters; + } + + /** + * Set binding parameters of the Binding resource. + * + * @param bindingParameters the bindingParameters value to set + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withBindingParameters(Map bindingParameters) { + this.bindingParameters = bindingParameters; + return this; + } + + /** + * Get the generated Spring Boot property file for this binding. The secret will be deducted. + * + * @return the generatedProperties value + */ + public String generatedProperties() { + return this.generatedProperties; + } + + /** + * Get creation time of the Binding resource. + * + * @return the createdAt value + */ + public String createdAt() { + return this.createdAt; + } + + /** + * Get update time of the Binding resource. + * + * @return the updatedAt value + */ + public String updatedAt() { + return this.updatedAt; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Bindings.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Bindings.java new file mode 100644 index 000000000000..2c7c5acd4405 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Bindings.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.v2020_11_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.BindingsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Bindings. + */ +public interface Bindings extends SupportsCreating, HasInner { + /** + * Get a Binding and its properties. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serviceName, String appName, String bindingName); + + /** + * Handles requests to list all resources in an App. + * + * @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); + + /** + * Operation to delete a Binding. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serviceName, String appName, String bindingName); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CertificateProperties.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CertificateProperties.java new file mode 100644 index 000000000000..8b1ef83c39e1 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CertificateResource.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CertificateResource.java new file mode 100644 index 000000000000..230cb8faa350 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.appplatform.v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Certificates.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Certificates.java new file mode 100644 index 000000000000..c142a6aa0b43 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ClusterResourceProperties.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ClusterResourceProperties.java new file mode 100644 index 000000000000..023c1a0e9308 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ClusterResourceProperties.java @@ -0,0 +1,90 @@ +/** + * 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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service properties payload. + */ +public class ClusterResourceProperties { + /** + * Provisioning state of the Service. Possible values include: 'Creating', + * 'Updating', 'Deleting', 'Deleted', 'Succeeded', 'Failed', 'Moving', + * 'Moved', 'MoveFailed'. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Network profile of the Service. + */ + @JsonProperty(value = "networkProfile") + private NetworkProfile networkProfile; + + /** + * Version of the Service. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private Integer version; + + /** + * ServiceInstanceEntity GUID which uniquely identifies a created resource. + */ + @JsonProperty(value = "serviceId", access = JsonProperty.Access.WRITE_ONLY) + private String serviceId; + + /** + * Get provisioning state of the Service. Possible values include: 'Creating', 'Updating', 'Deleting', 'Deleted', 'Succeeded', 'Failed', 'Moving', 'Moved', 'MoveFailed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * 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. + * + * @return the version value + */ + public Integer version() { + return this.version; + } + + /** + * Get serviceInstanceEntity GUID which uniquely identifies a created resource. + * + * @return the serviceId value + */ + public String serviceId() { + return this.serviceId; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerGitProperty.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerGitProperty.java new file mode 100644 index 000000000000..4f566e7c94b5 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerGitProperty.java @@ -0,0 +1,278 @@ +/** + * 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.v2020_11_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Property of git. + */ +public class ConfigServerGitProperty { + /** + * Repositories of git. + */ + @JsonProperty(value = "repositories") + private List repositories; + + /** + * URI of the repository. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** + * Label of the repository. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Searching path of the repository. + */ + @JsonProperty(value = "searchPaths") + private List searchPaths; + + /** + * Username of git repository basic auth. + */ + @JsonProperty(value = "username") + private String username; + + /** + * Password of git repository basic auth. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Public sshKey of git repository. + */ + @JsonProperty(value = "hostKey") + private String hostKey; + + /** + * SshKey algorithm of git repository. + */ + @JsonProperty(value = "hostKeyAlgorithm") + private String hostKeyAlgorithm; + + /** + * Private sshKey algorithm of git repository. + */ + @JsonProperty(value = "privateKey") + private String privateKey; + + /** + * Strict host key checking or not. + */ + @JsonProperty(value = "strictHostKeyChecking") + private Boolean strictHostKeyChecking; + + /** + * Get repositories of git. + * + * @return the repositories value + */ + public List repositories() { + return this.repositories; + } + + /** + * Set repositories of git. + * + * @param repositories the repositories value to set + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withRepositories(List repositories) { + this.repositories = repositories; + return this; + } + + /** + * Get uRI of the repository. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set uRI of the repository. + * + * @param uri the uri value to set + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get label of the repository. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set label of the repository. + * + * @param label the label value to set + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get searching path of the repository. + * + * @return the searchPaths value + */ + public List searchPaths() { + return this.searchPaths; + } + + /** + * Set searching path of the repository. + * + * @param searchPaths the searchPaths value to set + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withSearchPaths(List searchPaths) { + this.searchPaths = searchPaths; + return this; + } + + /** + * Get username of git repository basic auth. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set username of git repository basic auth. + * + * @param username the username value to set + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get password of git repository basic auth. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set password of git repository basic auth. + * + * @param password the password value to set + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get public sshKey of git repository. + * + * @return the hostKey value + */ + public String hostKey() { + return this.hostKey; + } + + /** + * Set public sshKey of git repository. + * + * @param hostKey the hostKey value to set + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withHostKey(String hostKey) { + this.hostKey = hostKey; + return this; + } + + /** + * Get sshKey algorithm of git repository. + * + * @return the hostKeyAlgorithm value + */ + public String hostKeyAlgorithm() { + return this.hostKeyAlgorithm; + } + + /** + * Set sshKey algorithm of git repository. + * + * @param hostKeyAlgorithm the hostKeyAlgorithm value to set + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withHostKeyAlgorithm(String hostKeyAlgorithm) { + this.hostKeyAlgorithm = hostKeyAlgorithm; + return this; + } + + /** + * Get private sshKey algorithm of git repository. + * + * @return the privateKey value + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set private sshKey algorithm of git repository. + * + * @param privateKey the privateKey value to set + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get strict host key checking or not. + * + * @return the strictHostKeyChecking value + */ + public Boolean strictHostKeyChecking() { + return this.strictHostKeyChecking; + } + + /** + * Set strict host key checking or not. + * + * @param strictHostKeyChecking the strictHostKeyChecking value to set + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withStrictHostKeyChecking(Boolean strictHostKeyChecking) { + this.strictHostKeyChecking = strictHostKeyChecking; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerProperties.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerProperties.java new file mode 100644 index 000000000000..4f65086f5571 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerProperties.java @@ -0,0 +1,85 @@ +/** + * 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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Config server git properties payload. + */ +public class ConfigServerProperties { + /** + * State of the config server. Possible values include: 'NotAvailable', + * 'Deleted', 'Failed', 'Succeeded', 'Updating'. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ConfigServerState provisioningState; + + /** + * Error when apply config server settings. + */ + @JsonProperty(value = "error") + private Error error; + + /** + * Settings of config server. + */ + @JsonProperty(value = "configServer") + private ConfigServerSettings configServer; + + /** + * Get state of the config server. Possible values include: 'NotAvailable', 'Deleted', 'Failed', 'Succeeded', 'Updating'. + * + * @return the provisioningState value + */ + public ConfigServerState provisioningState() { + return this.provisioningState; + } + + /** + * Get error when apply config server settings. + * + * @return the error value + */ + public Error error() { + return this.error; + } + + /** + * Set error when apply config server settings. + * + * @param error the error value to set + * @return the ConfigServerProperties object itself. + */ + public ConfigServerProperties withError(Error error) { + this.error = error; + return this; + } + + /** + * Get settings of config server. + * + * @return the configServer value + */ + public ConfigServerSettings configServer() { + return this.configServer; + } + + /** + * Set settings of config server. + * + * @param configServer the configServer value to set + * @return the ConfigServerProperties object itself. + */ + public ConfigServerProperties withConfigServer(ConfigServerSettings configServer) { + this.configServer = configServer; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerResource.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerResource.java new file mode 100644 index 000000000000..696a688457d8 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerResource.java @@ -0,0 +1,40 @@ +/** + * 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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.AppPlatformManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.ConfigServerResourceInner; + +/** + * Type representing ConfigServerResource. + */ +public interface ConfigServerResource extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ConfigServerProperties properties(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerSettings.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerSettings.java new file mode 100644 index 000000000000..9b7013b8f2a4 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerSettings.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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The settings of config server. + */ +public class ConfigServerSettings { + /** + * Property of git environment. + */ + @JsonProperty(value = "gitProperty") + private ConfigServerGitProperty gitProperty; + + /** + * Get property of git environment. + * + * @return the gitProperty value + */ + public ConfigServerGitProperty gitProperty() { + return this.gitProperty; + } + + /** + * Set property of git environment. + * + * @param gitProperty the gitProperty value to set + * @return the ConfigServerSettings object itself. + */ + public ConfigServerSettings withGitProperty(ConfigServerGitProperty gitProperty) { + this.gitProperty = gitProperty; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerSettingsErrorRecord.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerSettingsErrorRecord.java new file mode 100644 index 000000000000..a3729b7f5fc3 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerSettingsErrorRecord.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.v2020_11_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error record of the config server settings. + */ +public class ConfigServerSettingsErrorRecord { + /** + * The name of the config server settings error record. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The uri of the config server settings error record. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * The detail error messages of the record. + */ + @JsonProperty(value = "messages") + private List messages; + + /** + * Get the name of the config server settings error record. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the config server settings error record. + * + * @param name the name value to set + * @return the ConfigServerSettingsErrorRecord object itself. + */ + public ConfigServerSettingsErrorRecord withName(String name) { + this.name = name; + return this; + } + + /** + * Get the uri of the config server settings error record. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri of the config server settings error record. + * + * @param uri the uri value to set + * @return the ConfigServerSettingsErrorRecord object itself. + */ + public ConfigServerSettingsErrorRecord withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the detail error messages of the record. + * + * @return the messages value + */ + public List messages() { + return this.messages; + } + + /** + * Set the detail error messages of the record. + * + * @param messages the messages value to set + * @return the ConfigServerSettingsErrorRecord object itself. + */ + public ConfigServerSettingsErrorRecord withMessages(List messages) { + this.messages = messages; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerSettingsValidateResult.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerSettingsValidateResult.java new file mode 100644 index 000000000000..1989aeecf086 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerSettingsValidateResult.java @@ -0,0 +1,31 @@ +/** + * 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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.AppPlatformManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.ConfigServerSettingsValidateResultInner; +import java.util.List; + +/** + * Type representing ConfigServerSettingsValidateResult. + */ +public interface ConfigServerSettingsValidateResult extends HasInner, HasManager { + /** + * @return the details value. + */ + List details(); + + /** + * @return the isValid value. + */ + Boolean isValid(); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerState.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerState.java new file mode 100644 index 000000000000..d91aa5b59c12 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServerState.java @@ -0,0 +1,50 @@ +/** + * 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.v2020_11_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ConfigServerState. + */ +public final class ConfigServerState extends ExpandableStringEnum { + /** Static value NotAvailable for ConfigServerState. */ + public static final ConfigServerState NOT_AVAILABLE = fromString("NotAvailable"); + + /** Static value Deleted for ConfigServerState. */ + public static final ConfigServerState DELETED = fromString("Deleted"); + + /** Static value Failed for ConfigServerState. */ + public static final ConfigServerState FAILED = fromString("Failed"); + + /** Static value Succeeded for ConfigServerState. */ + public static final ConfigServerState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for ConfigServerState. */ + public static final ConfigServerState UPDATING = fromString("Updating"); + + /** + * Creates or finds a ConfigServerState from its string representation. + * @param name a name to look for + * @return the corresponding ConfigServerState + */ + @JsonCreator + public static ConfigServerState fromString(String name) { + return fromString(name, ConfigServerState.class); + } + + /** + * @return known ConfigServerState values + */ + public static Collection values() { + return values(ConfigServerState.class); + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServers.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServers.java new file mode 100644 index 000000000000..2ab2f51cfd38 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ConfigServers.java @@ -0,0 +1,59 @@ +/** + * 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.v2020_11_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.ConfigServersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ConfigServers. + */ +public interface ConfigServers extends HasInner { + /** + * Get the config server and its properties. + * + * @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 getAsync(String resourceGroupName, String serviceName); + + /** + * Update the config server. + * + * @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 updatePutAsync(String resourceGroupName, String serviceName); + + /** + * Update the config server. + * + * @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 updatePatchAsync(String resourceGroupName, String serviceName); + + /** + * Check if the config server settings are valid. + * + * @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 validateAsync(String resourceGroupName, String serviceName); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CustomDomainProperties.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CustomDomainProperties.java new file mode 100644 index 000000000000..790452838f05 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CustomDomainResource.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CustomDomainResource.java new file mode 100644 index 000000000000..ed7cb2132bb9 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.appplatform.v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CustomDomainValidatePayload.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CustomDomainValidatePayload.java new file mode 100644 index 000000000000..23982f13181a --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CustomDomainValidateResult.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CustomDomainValidateResult.java new file mode 100644 index 000000000000..53c839a0c4e0 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.AppPlatformManager; +import com.microsoft.azure.management.appplatform.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CustomDomains.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CustomDomains.java new file mode 100644 index 000000000000..ed8397e482c1 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/CustomDomains.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.v2020_11_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.CustomDomainsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing CustomDomains. + */ +public interface CustomDomains extends SupportsCreating, HasInner { + /** + * 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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentInstance.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentInstance.java new file mode 100644 index 000000000000..e53fabe9bc72 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentInstance.java @@ -0,0 +1,92 @@ +/** + * 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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Deployment instance payload. + */ +public class DeploymentInstance { + /** + * Name of the deployment instance. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Status of the deployment instance. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * Failed reason of the deployment instance. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /** + * Discovery status of the deployment instance. + */ + @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. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get status of the deployment instance. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get failed reason of the deployment instance. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Get discovery status of the deployment instance. + * + * @return the discoveryStatus value + */ + 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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentResource.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentResource.java new file mode 100644 index 000000000000..af837947d304 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentResource.java @@ -0,0 +1,148 @@ +/** + * 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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.DeploymentResourceInner; +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.v2020_11_01_preview.implementation.AppPlatformManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.SkuInner; + +/** + * Type representing DeploymentResource. + */ +public interface DeploymentResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + DeploymentResourceProperties properties(); + + /** + * @return the sku value. + */ + SkuInner sku(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the DeploymentResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithApp, DefinitionStages.WithCreate { + } + + /** + * Grouping of DeploymentResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DeploymentResource definition. + */ + interface Blank extends WithApp { + } + + /** + * The stage of the deploymentresource 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 + */ + WithCreate withExistingApp(String resourceGroupName, String serviceName, String appName); + } + + /** + * The stage of the deploymentresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Deployment resource + * @return the next definition stage + */ + WithCreate withProperties(DeploymentResourceProperties properties); + } + + /** + * The stage of the deploymentresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku Sku of the Deployment resource + * @return the next definition stage + */ + WithCreate withSku(SkuInner sku); + } + + /** + * 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, DefinitionStages.WithProperties, DefinitionStages.WithSku { + } + } + /** + * The template for a DeploymentResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties, UpdateStages.WithSku { + } + + /** + * Grouping of DeploymentResource update stages. + */ + interface UpdateStages { + /** + * The stage of the deploymentresource update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Deployment resource + * @return the next update stage + */ + Update withProperties(DeploymentResourceProperties properties); + } + + /** + * The stage of the deploymentresource update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku Sku of the Deployment resource + * @return the next update stage + */ + Update withSku(SkuInner sku); + } + + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentResourceProperties.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentResourceProperties.java new file mode 100644 index 000000000000..47a669c5d18b --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentResourceProperties.java @@ -0,0 +1,163 @@ +/** + * 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.v2020_11_01_preview; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Deployment resource properties payload. + */ +public class DeploymentResourceProperties { + /** + * Uploaded source information of the deployment. + */ + @JsonProperty(value = "source") + private UserSourceInfo source; + + /** + * App name of the deployment. + */ + @JsonProperty(value = "appName", access = JsonProperty.Access.WRITE_ONLY) + private String appName; + + /** + * Deployment settings of the Deployment. + */ + @JsonProperty(value = "deploymentSettings") + private DeploymentSettings deploymentSettings; + + /** + * Provisioning state of the Deployment. Possible values include: + * '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', 'Allocating', 'Upgrading', 'Compiling'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentResourceStatus status; + + /** + * Indicates whether the Deployment is active. + */ + @JsonProperty(value = "active", access = JsonProperty.Access.WRITE_ONLY) + private Boolean active; + + /** + * Date time when the resource is created. + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdTime; + + /** + * Collection of instances belong to the Deployment. + */ + @JsonProperty(value = "instances", access = JsonProperty.Access.WRITE_ONLY) + private List instances; + + /** + * Get uploaded source information of the deployment. + * + * @return the source value + */ + public UserSourceInfo source() { + return this.source; + } + + /** + * Set uploaded source information of the deployment. + * + * @param source the source value to set + * @return the DeploymentResourceProperties object itself. + */ + public DeploymentResourceProperties withSource(UserSourceInfo source) { + this.source = source; + return this; + } + + /** + * Get app name of the deployment. + * + * @return the appName value + */ + public String appName() { + return this.appName; + } + + /** + * Get deployment settings of the Deployment. + * + * @return the deploymentSettings value + */ + public DeploymentSettings deploymentSettings() { + return this.deploymentSettings; + } + + /** + * Set deployment settings of the Deployment. + * + * @param deploymentSettings the deploymentSettings value to set + * @return the DeploymentResourceProperties object itself. + */ + public DeploymentResourceProperties withDeploymentSettings(DeploymentSettings deploymentSettings) { + this.deploymentSettings = deploymentSettings; + return this; + } + + /** + * Get provisioning state of the Deployment. Possible values include: 'Creating', 'Updating', 'Succeeded', 'Failed'. + * + * @return the provisioningState value + */ + public DeploymentResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get status of the Deployment. Possible values include: 'Unknown', 'Stopped', 'Running', 'Failed', 'Allocating', 'Upgrading', 'Compiling'. + * + * @return the status value + */ + public DeploymentResourceStatus status() { + return this.status; + } + + /** + * Get indicates whether the Deployment is active. + * + * @return the active value + */ + public Boolean active() { + return this.active; + } + + /** + * Get date time when the resource is created. + * + * @return the createdTime value + */ + public DateTime createdTime() { + return this.createdTime; + } + + /** + * Get collection of instances belong to the Deployment. + * + * @return the instances value + */ + public List instances() { + return this.instances; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentResourceProvisioningState.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentResourceProvisioningState.java new file mode 100644 index 000000000000..8de18915221d --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentResourceProvisioningState.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.v2020_11_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DeploymentResourceProvisioningState. + */ +public final class DeploymentResourceProvisioningState extends ExpandableStringEnum { + /** Static value Creating for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a DeploymentResourceProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding DeploymentResourceProvisioningState + */ + @JsonCreator + public static DeploymentResourceProvisioningState fromString(String name) { + return fromString(name, DeploymentResourceProvisioningState.class); + } + + /** + * @return known DeploymentResourceProvisioningState values + */ + public static Collection values() { + return values(DeploymentResourceProvisioningState.class); + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentResourceStatus.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentResourceStatus.java new file mode 100644 index 000000000000..8fd6ac8d55ff --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentResourceStatus.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.v2020_11_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DeploymentResourceStatus. + */ +public final class DeploymentResourceStatus extends ExpandableStringEnum { + /** Static value Unknown for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus UNKNOWN = fromString("Unknown"); + + /** Static value Stopped for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus STOPPED = fromString("Stopped"); + + /** Static value Running for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus RUNNING = fromString("Running"); + + /** Static value Failed for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus FAILED = fromString("Failed"); + + /** Static value Allocating for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus ALLOCATING = fromString("Allocating"); + + /** Static value Upgrading for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus UPGRADING = fromString("Upgrading"); + + /** Static value Compiling for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus COMPILING = fromString("Compiling"); + + /** + * Creates or finds a DeploymentResourceStatus from its string representation. + * @param name a name to look for + * @return the corresponding DeploymentResourceStatus + */ + @JsonCreator + public static DeploymentResourceStatus fromString(String name) { + return fromString(name, DeploymentResourceStatus.class); + } + + /** + * @return known DeploymentResourceStatus values + */ + public static Collection values() { + return values(DeploymentResourceStatus.class); + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentSettings.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentSettings.java new file mode 100644 index 000000000000..badbaaeb3850 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/DeploymentSettings.java @@ -0,0 +1,177 @@ +/** + * 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.v2020_11_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Deployment settings payload. + */ +public class DeploymentSettings { + /** + * Required CPU, basic tier should be 1, standard tier should be in range + * (1, 4). + */ + @JsonProperty(value = "cpu") + private Integer cpu; + + /** + * Required Memory size in GB, basic tier should be in range (1, 2), + * standard tier should be in range (1, 8). + */ + @JsonProperty(value = "memoryInGB") + private Integer memoryInGB; + + /** + * JVM parameter. + */ + @JsonProperty(value = "jvmOptions") + private String jvmOptions; + + /** + * The path to the .NET executable relative to zip root. + */ + @JsonProperty(value = "netCoreMainEntryPath") + private String netCoreMainEntryPath; + + /** + * Collection of environment variables. + */ + @JsonProperty(value = "environmentVariables") + private Map environmentVariables; + + /** + * Runtime version. Possible values include: 'Java_8', 'Java_11', + * 'NetCore_31'. + */ + @JsonProperty(value = "runtimeVersion") + private RuntimeVersion runtimeVersion; + + /** + * Get required CPU, basic tier should be 1, standard tier should be in range (1, 4). + * + * @return the cpu value + */ + public Integer cpu() { + return this.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. + */ + public DeploymentSettings withCpu(Integer cpu) { + this.cpu = cpu; + return this; + } + + /** + * 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 + */ + public Integer memoryInGB() { + return this.memoryInGB; + } + + /** + * 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. + */ + public DeploymentSettings withMemoryInGB(Integer memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get jVM parameter. + * + * @return the jvmOptions value + */ + public String jvmOptions() { + return this.jvmOptions; + } + + /** + * Set jVM parameter. + * + * @param jvmOptions the jvmOptions value to set + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withJvmOptions(String jvmOptions) { + this.jvmOptions = jvmOptions; + return this; + } + + /** + * 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 collection of environment variables. + * + * @return the environmentVariables value + */ + public Map environmentVariables() { + return this.environmentVariables; + } + + /** + * Set collection of environment variables. + * + * @param environmentVariables the environmentVariables value to set + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withEnvironmentVariables(Map environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get runtime version. Possible values include: 'Java_8', 'Java_11', 'NetCore_31'. + * + * @return the runtimeVersion value + */ + public RuntimeVersion runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Set runtime version. Possible values include: 'Java_8', 'Java_11', 'NetCore_31'. + * + * @param runtimeVersion the runtimeVersion value to set + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withRuntimeVersion(RuntimeVersion runtimeVersion) { + this.runtimeVersion = runtimeVersion; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Deployments.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Deployments.java new file mode 100644 index 000000000000..56c57d8576ab --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Deployments.java @@ -0,0 +1,114 @@ +/** + * 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.v2020_11_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.DeploymentsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Deployments. + */ +public interface Deployments extends SupportsCreating, HasInner { + /** + * List deployments for a certain 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 + */ + Observable listForClusterAsync(final String resourceGroupName, final String serviceName); + + /** + * Start the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Stop the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Restart the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable restartAsync(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Get deployment log file URL. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getLogFileUrlAsync(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Get a Deployment and its properties. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Handles requests to list all resources in an App. + * + * @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); + + /** + * Operation to delete a Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serviceName, String appName, String deploymentName); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Error.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Error.java new file mode 100644 index 000000000000..812fd3458d12 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Error.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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error code compose of code and message. + */ +public class Error { + /** + * The code of error. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The message of error. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code of error. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code of error. + * + * @param code the code value to set + * @return the Error object itself. + */ + public Error withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message of error. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message of error. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/GitPatternRepository.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/GitPatternRepository.java new file mode 100644 index 000000000000..cdcfcbd09bfd --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/GitPatternRepository.java @@ -0,0 +1,304 @@ +/** + * 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.v2020_11_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Git repository property payload. + */ +public class GitPatternRepository { + /** + * Name of the repository. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Collection of pattern of the repository. + */ + @JsonProperty(value = "pattern") + private List pattern; + + /** + * URI of the repository. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** + * Label of the repository. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Searching path of the repository. + */ + @JsonProperty(value = "searchPaths") + private List searchPaths; + + /** + * Username of git repository basic auth. + */ + @JsonProperty(value = "username") + private String username; + + /** + * Password of git repository basic auth. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Public sshKey of git repository. + */ + @JsonProperty(value = "hostKey") + private String hostKey; + + /** + * SshKey algorithm of git repository. + */ + @JsonProperty(value = "hostKeyAlgorithm") + private String hostKeyAlgorithm; + + /** + * Private sshKey algorithm of git repository. + */ + @JsonProperty(value = "privateKey") + private String privateKey; + + /** + * Strict host key checking or not. + */ + @JsonProperty(value = "strictHostKeyChecking") + private Boolean strictHostKeyChecking; + + /** + * Get name of the repository. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the repository. + * + * @param name the name value to set + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withName(String name) { + this.name = name; + return this; + } + + /** + * Get collection of pattern of the repository. + * + * @return the pattern value + */ + public List pattern() { + return this.pattern; + } + + /** + * Set collection of pattern of the repository. + * + * @param pattern the pattern value to set + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withPattern(List pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get uRI of the repository. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set uRI of the repository. + * + * @param uri the uri value to set + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get label of the repository. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set label of the repository. + * + * @param label the label value to set + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get searching path of the repository. + * + * @return the searchPaths value + */ + public List searchPaths() { + return this.searchPaths; + } + + /** + * Set searching path of the repository. + * + * @param searchPaths the searchPaths value to set + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withSearchPaths(List searchPaths) { + this.searchPaths = searchPaths; + return this; + } + + /** + * Get username of git repository basic auth. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set username of git repository basic auth. + * + * @param username the username value to set + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get password of git repository basic auth. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set password of git repository basic auth. + * + * @param password the password value to set + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get public sshKey of git repository. + * + * @return the hostKey value + */ + public String hostKey() { + return this.hostKey; + } + + /** + * Set public sshKey of git repository. + * + * @param hostKey the hostKey value to set + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withHostKey(String hostKey) { + this.hostKey = hostKey; + return this; + } + + /** + * Get sshKey algorithm of git repository. + * + * @return the hostKeyAlgorithm value + */ + public String hostKeyAlgorithm() { + return this.hostKeyAlgorithm; + } + + /** + * Set sshKey algorithm of git repository. + * + * @param hostKeyAlgorithm the hostKeyAlgorithm value to set + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withHostKeyAlgorithm(String hostKeyAlgorithm) { + this.hostKeyAlgorithm = hostKeyAlgorithm; + return this; + } + + /** + * Get private sshKey algorithm of git repository. + * + * @return the privateKey value + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set private sshKey algorithm of git repository. + * + * @param privateKey the privateKey value to set + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get strict host key checking or not. + * + * @return the strictHostKeyChecking value + */ + public Boolean strictHostKeyChecking() { + return this.strictHostKeyChecking; + } + + /** + * Set strict host key checking or not. + * + * @param strictHostKeyChecking the strictHostKeyChecking value to set + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withStrictHostKeyChecking(Boolean strictHostKeyChecking) { + this.strictHostKeyChecking = strictHostKeyChecking; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/LogFileUrlResponse.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/LogFileUrlResponse.java new file mode 100644 index 000000000000..e515e654e949 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/LogFileUrlResponse.java @@ -0,0 +1,25 @@ +/** + * 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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.AppPlatformManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.LogFileUrlResponseInner; + +/** + * Type representing LogFileUrlResponse. + */ +public interface LogFileUrlResponse extends HasInner, HasManager { + /** + * @return the url value. + */ + String url(); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/LogSpecification.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/LogSpecification.java new file mode 100644 index 000000000000..1b42d90facfe --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/LogSpecification.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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications of the Log for Azure Monitoring. + */ +public class LogSpecification { + /** + * Name of the log. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized friendly display name of the log. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Blob duration of the log. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get name of the log. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the log. + * + * @param name the name value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized friendly display name of the log. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized friendly display name of the log. + * + * @param displayName the displayName value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get blob duration of the log. + * + * @return the blobDuration value + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set blob duration of the log. + * + * @param blobDuration the blobDuration value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ManagedIdentityProperties.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ManagedIdentityProperties.java new file mode 100644 index 000000000000..794de47406a4 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Managed identity properties retrieved from ARM request headers. + */ +public class ManagedIdentityProperties { + /** + * Type of the managed identity. Possible values include: 'None', + * 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned'. + */ + @JsonProperty(value = "type") + private ManagedIdentityType type; + + /** + * Principal Id. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /** + * Tenant Id. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * Get type of the managed identity. Possible values include: 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned'. + * + * @return the type value + */ + public ManagedIdentityType type() { + return this.type; + } + + /** + * Set type of the managed identity. 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 principal Id. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set principal Id. + * + * @param principalId the principalId value to set + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get tenant Id. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set tenant Id. + * + * @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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ManagedIdentityType.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ManagedIdentityType.java new file mode 100644 index 000000000000..03293a40ac14 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MetricDimension.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MetricDimension.java new file mode 100644 index 000000000000..f178528a2ace --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MetricDimension.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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications of the Dimension of metrics. + */ +public class MetricDimension { + /** + * Name of the dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized friendly display name of the dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get name of the dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the dimension. + * + * @param name the name value to set + * @return the MetricDimension object itself. + */ + public MetricDimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized friendly display name of the dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized friendly display name of the dimension. + * + * @param displayName the displayName value to set + * @return the MetricDimension object itself. + */ + public MetricDimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MetricSpecification.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MetricSpecification.java new file mode 100644 index 000000000000..82660f9c05ca --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MetricSpecification.java @@ -0,0 +1,281 @@ +/** + * 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.v2020_11_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications of the Metrics for Azure Monitoring. + */ +public class MetricSpecification { + /** + * Name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized friendly display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Localized friendly description of the metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Unit that makes sense for the metric. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Name of the metric category that the metric belongs to. A metric can + * only belong to a single category. + */ + @JsonProperty(value = "category") + private String category; + + /** + * Only provide one value for this field. Valid values: Average, Minimum, + * Maximum, Total, Count. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * Supported aggregation types. + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /** + * Supported time grain types. + */ + @JsonProperty(value = "supportedTimeGrainTypes") + private List supportedTimeGrainTypes; + + /** + * Optional. If set to true, then zero will be returned for time duration + * where no metric is emitted/published. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /** + * Dimensions of the metric. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Get name of the metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the metric. + * + * @param name the name value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized friendly display name of the metric. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized friendly display name of the metric. + * + * @param displayName the displayName value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get localized friendly description of the metric. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set localized friendly description of the metric. + * + * @param displayDescription the displayDescription value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get unit that makes sense for the metric. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set unit that makes sense for the metric. + * + * @param unit the unit value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get name of the metric category that the metric belongs to. A metric can only belong to a single category. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set name of the metric category that the metric belongs to. A metric can only belong to a single category. + * + * @param category the category value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + * + * @param aggregationType the aggregationType value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get supported aggregation types. + * + * @return the supportedAggregationTypes value + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set supported aggregation types. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + + /** + * Get supported time grain types. + * + * @return the supportedTimeGrainTypes value + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Set supported time grain types. + * + * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { + this.supportedTimeGrainTypes = supportedTimeGrainTypes; + return this; + } + + /** + * Get optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. + * + * @return the fillGapWithZero value + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. + * + * @param fillGapWithZero the fillGapWithZero value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get dimensions of the metric. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set dimensions of the metric. + * + * @param dimensions the dimensions value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MonitoringSettingProperties.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MonitoringSettingProperties.java new file mode 100644 index 000000000000..0462d0390b0f --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MonitoringSettingProperties.java @@ -0,0 +1,168 @@ +/** + * 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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Monitoring Setting properties payload. + */ +public class MonitoringSettingProperties { + /** + * State of the Monitoring Setting. Possible values include: + * 'NotAvailable', 'Failed', 'Succeeded', 'Updating'. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private MonitoringSettingState provisioningState; + + /** + * Error when apply Monitoring Setting changes. + */ + @JsonProperty(value = "error") + private Error error; + + /** + * Indicates whether enable the trace functionality, which will be + * deprecated since api version 2020-11-01-preview. Please leverage + * appInsightsInstrumentationKey to indicate if monitoringSettings enabled + * or not. + */ + @JsonProperty(value = "traceEnabled") + private Boolean traceEnabled; + + /** + * Target application insight instrumentation key, null or whitespace + * include empty will disable monitoringSettings. + */ + @JsonProperty(value = "appInsightsInstrumentationKey") + private String appInsightsInstrumentationKey; + + /** + * Indicates the sampling rate of application insight agent, should be in + * range [0.0, 100.0]. + */ + @JsonProperty(value = "appInsightsSamplingRate") + private Double appInsightsSamplingRate; + + /** + * Indicates the versions of application insight agent. + */ + @JsonProperty(value = "appInsightsAgentVersions") + private ApplicationInsightsAgentVersions appInsightsAgentVersions; + + /** + * Get state of the Monitoring Setting. Possible values include: 'NotAvailable', 'Failed', 'Succeeded', 'Updating'. + * + * @return the provisioningState value + */ + public MonitoringSettingState provisioningState() { + return this.provisioningState; + } + + /** + * Get error when apply Monitoring Setting changes. + * + * @return the error value + */ + public Error error() { + return this.error; + } + + /** + * Set error when apply Monitoring Setting changes. + * + * @param error the error value to set + * @return the MonitoringSettingProperties object itself. + */ + public MonitoringSettingProperties withError(Error error) { + this.error = error; + return this; + } + + /** + * Get indicates whether enable the trace functionality, which will be deprecated since api version 2020-11-01-preview. Please leverage appInsightsInstrumentationKey to indicate if monitoringSettings enabled or not. + * + * @return the traceEnabled value + */ + public Boolean traceEnabled() { + return this.traceEnabled; + } + + /** + * Set indicates whether enable the trace functionality, which will be deprecated since api version 2020-11-01-preview. Please leverage appInsightsInstrumentationKey to indicate if monitoringSettings enabled or not. + * + * @param traceEnabled the traceEnabled value to set + * @return the MonitoringSettingProperties object itself. + */ + public MonitoringSettingProperties withTraceEnabled(Boolean traceEnabled) { + this.traceEnabled = traceEnabled; + return this; + } + + /** + * Get target application insight instrumentation key, null or whitespace include empty will disable monitoringSettings. + * + * @return the appInsightsInstrumentationKey value + */ + public String appInsightsInstrumentationKey() { + return this.appInsightsInstrumentationKey; + } + + /** + * Set target application insight instrumentation key, null or whitespace include empty will disable monitoringSettings. + * + * @param appInsightsInstrumentationKey the appInsightsInstrumentationKey value to set + * @return the MonitoringSettingProperties object itself. + */ + public MonitoringSettingProperties withAppInsightsInstrumentationKey(String appInsightsInstrumentationKey) { + this.appInsightsInstrumentationKey = appInsightsInstrumentationKey; + return this; + } + + /** + * Get indicates the sampling rate of application insight agent, should be in range [0.0, 100.0]. + * + * @return the appInsightsSamplingRate value + */ + public Double appInsightsSamplingRate() { + return this.appInsightsSamplingRate; + } + + /** + * Set indicates the sampling rate of application insight agent, should be in range [0.0, 100.0]. + * + * @param appInsightsSamplingRate the appInsightsSamplingRate value to set + * @return the MonitoringSettingProperties object itself. + */ + public MonitoringSettingProperties withAppInsightsSamplingRate(Double appInsightsSamplingRate) { + this.appInsightsSamplingRate = appInsightsSamplingRate; + return this; + } + + /** + * Get indicates the versions of application insight agent. + * + * @return the appInsightsAgentVersions value + */ + public ApplicationInsightsAgentVersions appInsightsAgentVersions() { + return this.appInsightsAgentVersions; + } + + /** + * Set indicates the versions of application insight agent. + * + * @param appInsightsAgentVersions the appInsightsAgentVersions value to set + * @return the MonitoringSettingProperties object itself. + */ + public MonitoringSettingProperties withAppInsightsAgentVersions(ApplicationInsightsAgentVersions appInsightsAgentVersions) { + this.appInsightsAgentVersions = appInsightsAgentVersions; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MonitoringSettingResource.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MonitoringSettingResource.java new file mode 100644 index 000000000000..925fc8a05267 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MonitoringSettingResource.java @@ -0,0 +1,40 @@ +/** + * 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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.AppPlatformManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.MonitoringSettingResourceInner; + +/** + * Type representing MonitoringSettingResource. + */ +public interface MonitoringSettingResource extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + MonitoringSettingProperties properties(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MonitoringSettingState.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MonitoringSettingState.java new file mode 100644 index 000000000000..b5c2e8b576f9 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MonitoringSettingState.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.v2020_11_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MonitoringSettingState. + */ +public final class MonitoringSettingState extends ExpandableStringEnum { + /** Static value NotAvailable for MonitoringSettingState. */ + public static final MonitoringSettingState NOT_AVAILABLE = fromString("NotAvailable"); + + /** Static value Failed for MonitoringSettingState. */ + public static final MonitoringSettingState FAILED = fromString("Failed"); + + /** Static value Succeeded for MonitoringSettingState. */ + public static final MonitoringSettingState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for MonitoringSettingState. */ + public static final MonitoringSettingState UPDATING = fromString("Updating"); + + /** + * Creates or finds a MonitoringSettingState from its string representation. + * @param name a name to look for + * @return the corresponding MonitoringSettingState + */ + @JsonCreator + public static MonitoringSettingState fromString(String name) { + return fromString(name, MonitoringSettingState.class); + } + + /** + * @return known MonitoringSettingState values + */ + public static Collection values() { + return values(MonitoringSettingState.class); + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MonitoringSettings.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MonitoringSettings.java new file mode 100644 index 000000000000..b32231f5c82e --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/MonitoringSettings.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2020_11_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.MonitoringSettingsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing MonitoringSettings. + */ +public interface MonitoringSettings extends HasInner { + /** + * Get the Monitoring Setting and its properties. + * + * @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 getAsync(String resourceGroupName, String serviceName); + + /** + * Update the Monitoring Setting. + * + * @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 updatePutAsync(String resourceGroupName, String serviceName); + + /** + * Update the Monitoring Setting. + * + * @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 updatePatchAsync(String resourceGroupName, String serviceName); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/NameAvailability.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/NameAvailability.java new file mode 100644 index 000000000000..29c4a903d6db --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/NameAvailability.java @@ -0,0 +1,35 @@ +/** + * 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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.AppPlatformManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.NameAvailabilityInner; + +/** + * Type representing NameAvailability. + */ +public interface NameAvailability extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/NameAvailabilityParameters.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/NameAvailabilityParameters.java new file mode 100644 index 000000000000..ecf1db860e1c --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/NameAvailabilityParameters.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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Name availability parameters payload. + */ +public class NameAvailabilityParameters { + /** + * Type of the resource to check name availability. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Name to be checked. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get type of the resource to check name availability. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource to check name availability. + * + * @param type the type value to set + * @return the NameAvailabilityParameters object itself. + */ + public NameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Get name to be checked. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name to be checked. + * + * @param name the name value to set + * @return the NameAvailabilityParameters object itself. + */ + public NameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/NetworkProfile.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/NetworkProfile.java new file mode 100644 index 000000000000..0a2c8813db31 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/NetworkProfile.java @@ -0,0 +1,182 @@ +/** + * 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.v2020_11_01_preview; + +import java.util.List; +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; + + /** + * Required inbound or outbound traffics for Azure Spring Cloud instance. + */ + @JsonProperty(value = "requiredTraffics", access = JsonProperty.Access.WRITE_ONLY) + private List requiredTraffics; + + /** + * 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; + } + + /** + * Get required inbound or outbound traffics for Azure Spring Cloud instance. + * + * @return the requiredTraffics value + */ + public List requiredTraffics() { + return this.requiredTraffics; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/NetworkProfileOutboundIPs.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/NetworkProfileOutboundIPs.java new file mode 100644 index 000000000000..df7e3f644fb6 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/OperationDetail.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/OperationDetail.java new file mode 100644 index 000000000000..22c1c3a8f297 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/OperationDetail.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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.AppPlatformManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.OperationDetailInner; + +/** + * Type representing OperationDetail. + */ +public interface OperationDetail extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the properties value. + */ + OperationProperties properties(); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/OperationDisplay.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/OperationDisplay.java new file mode 100644 index 000000000000..0268675e54eb --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * 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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation display payload. + */ +public class OperationDisplay { + /** + * Resource provider of the operation. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource of the operation. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Localized friendly name for the operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Localized friendly description for the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get resource provider of the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set resource provider of the operation. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource of the operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource of the operation. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get localized friendly name for the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set localized friendly name for the operation. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get localized friendly description for the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set localized friendly description for the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/OperationProperties.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/OperationProperties.java new file mode 100644 index 000000000000..04a70891334b --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/OperationProperties.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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Extra Operation properties. + */ +public class OperationProperties { + /** + * Service specifications of the operation. + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get service specifications of the operation. + * + * @return the serviceSpecification value + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set service specifications of the operation. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Operations.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Operations.java new file mode 100644 index 000000000000..aae7b6b78199 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Operations.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.v2020_11_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/PersistentDisk.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/PersistentDisk.java new file mode 100644 index 000000000000..5860addf6410 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/PersistentDisk.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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Persistent disk payload. + */ +public class PersistentDisk { + /** + * Size of the persistent disk in GB. + */ + @JsonProperty(value = "sizeInGB") + private Integer sizeInGB; + + /** + * Size of the used persistent disk in GB. + */ + @JsonProperty(value = "usedInGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer usedInGB; + + /** + * Mount path of the persistent disk. + */ + @JsonProperty(value = "mountPath") + private String mountPath; + + /** + * Get size of the persistent disk in GB. + * + * @return the sizeInGB value + */ + public Integer sizeInGB() { + return this.sizeInGB; + } + + /** + * Set size of the persistent disk in GB. + * + * @param sizeInGB the sizeInGB value to set + * @return the PersistentDisk object itself. + */ + public PersistentDisk withSizeInGB(Integer sizeInGB) { + this.sizeInGB = sizeInGB; + return this; + } + + /** + * Get size of the used persistent disk in GB. + * + * @return the usedInGB value + */ + public Integer usedInGB() { + return this.usedInGB; + } + + /** + * Get mount path of the persistent disk. + * + * @return the mountPath value + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set mount path of the persistent disk. + * + * @param mountPath the mountPath value to set + * @return the PersistentDisk object itself. + */ + public PersistentDisk withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ProvisioningState.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ProvisioningState.java new file mode 100644 index 000000000000..020926321aed --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ProvisioningState.java @@ -0,0 +1,62 @@ +/** + * 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.v2020_11_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Moving for ProvisioningState. */ + public static final ProvisioningState MOVING = fromString("Moving"); + + /** Static value Moved for ProvisioningState. */ + public static final ProvisioningState MOVED = fromString("Moved"); + + /** Static value MoveFailed for ProvisioningState. */ + public static final ProvisioningState MOVE_FAILED = fromString("MoveFailed"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/RegenerateTestKeyRequestPayload.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/RegenerateTestKeyRequestPayload.java new file mode 100644 index 000000000000..82a8117698f9 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/RegenerateTestKeyRequestPayload.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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Regenerate test key request payload. + */ +public class RegenerateTestKeyRequestPayload { + /** + * Type of the test key. Possible values include: 'Primary', 'Secondary'. + */ + @JsonProperty(value = "keyType", required = true) + private TestKeyType keyType; + + /** + * Get type of the test key. Possible values include: 'Primary', 'Secondary'. + * + * @return the keyType value + */ + public TestKeyType keyType() { + return this.keyType; + } + + /** + * Set type of the test key. Possible values include: 'Primary', 'Secondary'. + * + * @param keyType the keyType value to set + * @return the RegenerateTestKeyRequestPayload object itself. + */ + public RegenerateTestKeyRequestPayload withKeyType(TestKeyType keyType) { + this.keyType = keyType; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/RequiredTraffic.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/RequiredTraffic.java new file mode 100644 index 000000000000..7c4e0468bece --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/RequiredTraffic.java @@ -0,0 +1,94 @@ +/** + * 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.v2020_11_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Required inbound or outbound traffic for Azure Spring Cloud instance. + */ +public class RequiredTraffic { + /** + * The protocol of required traffic. + */ + @JsonProperty(value = "protocol", access = JsonProperty.Access.WRITE_ONLY) + private String protocol; + + /** + * The port of required traffic. + */ + @JsonProperty(value = "port", access = JsonProperty.Access.WRITE_ONLY) + private Integer port; + + /** + * The ip list of required traffic. + */ + @JsonProperty(value = "ips", access = JsonProperty.Access.WRITE_ONLY) + private List ips; + + /** + * The FQDN list of required traffic. + */ + @JsonProperty(value = "fqdns", access = JsonProperty.Access.WRITE_ONLY) + private List fqdns; + + /** + * The direction of required traffic. Possible values include: 'Inbound', + * 'Outbound'. + */ + @JsonProperty(value = "direction", access = JsonProperty.Access.WRITE_ONLY) + private TrafficDirection direction; + + /** + * Get the protocol of required traffic. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Get the port of required traffic. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Get the ip list of required traffic. + * + * @return the ips value + */ + public List ips() { + return this.ips; + } + + /** + * Get the FQDN list of required traffic. + * + * @return the fqdns value + */ + public List fqdns() { + return this.fqdns; + } + + /** + * Get the direction of required traffic. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public TrafficDirection direction() { + return this.direction; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSku.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSku.java new file mode 100644 index 000000000000..684b6161ec95 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.ResourceSkuInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSkuCapabilities.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSkuCapabilities.java new file mode 100644 index 000000000000..b88eff9df1a3 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSkuLocationInfo.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSkuLocationInfo.java new file mode 100644 index 000000000000..d51a811fad1c --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Locations and availability zones where the SKU is available. + */ +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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSkuRestrictionInfo.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSkuRestrictionInfo.java new file mode 100644 index 000000000000..95e34b5b843d --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the restriction where the SKU cannot be used. + */ +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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSkuRestrictions.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSkuRestrictions.java new file mode 100644 index 000000000000..b197fb4b369a --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Restrictions where the SKU cannot be used. + */ +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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSkuRestrictionsReasonCode.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSkuRestrictionsReasonCode.java new file mode 100644 index 000000000000..1471905b9a66 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSkuRestrictionsType.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSkuRestrictionsType.java new file mode 100644 index 000000000000..0701905e78be --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSkuZoneDetails.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceSkuZoneDetails.java new file mode 100644 index 000000000000..826c6449f0e0 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of capabilities available to a SKU in specific zones. + */ +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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceUploadDefinition.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceUploadDefinition.java new file mode 100644 index 000000000000..1fc4d465cc8d --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ResourceUploadDefinition.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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.AppPlatformManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.ResourceUploadDefinitionInner; + +/** + * Type representing ResourceUploadDefinition. + */ +public interface ResourceUploadDefinition extends HasInner, HasManager { + /** + * @return the relativePath value. + */ + String relativePath(); + + /** + * @return the uploadUrl value. + */ + String uploadUrl(); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/RuntimeVersion.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/RuntimeVersion.java new file mode 100644 index 000000000000..416042f70ffe --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/RuntimeVersion.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.v2020_11_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RuntimeVersion. + */ +public final class RuntimeVersion extends ExpandableStringEnum { + /** Static value Java_8 for RuntimeVersion. */ + public static final RuntimeVersion JAVA_8 = fromString("Java_8"); + + /** 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 + * @return the corresponding RuntimeVersion + */ + @JsonCreator + public static RuntimeVersion fromString(String name) { + return fromString(name, RuntimeVersion.class); + } + + /** + * @return known RuntimeVersion values + */ + public static Collection values() { + return values(RuntimeVersion.class); + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/RuntimeVersions.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/RuntimeVersions.java new file mode 100644 index 000000000000..81f3088f4169 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ServiceResource.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ServiceResource.java new file mode 100644 index 000000000000..4ee5299a8f9a --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ServiceResource.java @@ -0,0 +1,57 @@ +/** + * 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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.AppPlatformManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.ServiceResourceInner; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.SkuInner; +import java.util.Map; + +/** + * Type representing ServiceResource. + */ +public interface ServiceResource extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ClusterResourceProperties properties(); + + /** + * @return the sku value. + */ + SkuInner sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ServiceSpecification.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ServiceSpecification.java new file mode 100644 index 000000000000..cdc0d3e903df --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/ServiceSpecification.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.v2020_11_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service specification payload. + */ +public class ServiceSpecification { + /** + * Specifications of the Log for Azure Monitoring. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Specifications of the Metrics for Azure Monitoring. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get specifications of the Log for Azure Monitoring. + * + * @return the logSpecifications value + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set specifications of the Log for Azure Monitoring. + * + * @param logSpecifications the logSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Get specifications of the Metrics for Azure Monitoring. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set specifications of the Metrics for Azure Monitoring. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Services.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Services.java new file mode 100644 index 000000000000..60534f033dbe --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Services.java @@ -0,0 +1,129 @@ +/** + * 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.v2020_11_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.ServiceResourceInner; + +/** + * Type representing Services. + */ +public interface Services { + /** + * Get a Service and its properties. + * + * @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 getByResourceGroupAsync(String resourceGroupName, String serviceName); + + /** + * 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 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, ServiceResourceInner resource); + + /** + * Operation to delete a 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 + */ + Completable deleteAsync(String resourceGroupName, String serviceName); + + /** + * 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 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, ServiceResourceInner resource); + + /** + * Regenerate a test key for a 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 keyType Type of the test key. Possible values include: 'Primary', 'Secondary' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateTestKeyAsync(String resourceGroupName, String serviceName, TestKeyType keyType); + + /** + * Disable test endpoint functionality for a 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 + */ + Completable disableTestEndpointAsync(String resourceGroupName, String serviceName); + + /** + * Enable test endpoint functionality for a 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 + */ + Observable enableTestEndpointAsync(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Handles requests to list all resources in a resource group. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(final String resourceGroupName); + + /** + * List test keys for a 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 + */ + Observable listTestKeysAsync(String resourceGroupName, String serviceName); + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region + * @param availabilityParameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String location, NameAvailabilityParameters availabilityParameters); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/SkuCapacity.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/SkuCapacity.java new file mode 100644 index 000000000000..ccc8de1d9622 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/SkuScaleType.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/SkuScaleType.java new file mode 100644 index 000000000000..f73df99b6e1a --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Skus.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/Skus.java new file mode 100644 index 000000000000..876d1f178a9d --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.appplatform.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/SupportedRuntimePlatform.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/SupportedRuntimePlatform.java new file mode 100644 index 000000000000..cca474c99e79 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/SupportedRuntimeValue.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/SupportedRuntimeValue.java new file mode 100644 index 000000000000..824f47e26d6e --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/SupportedRuntimeValue.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.v2020_11_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SupportedRuntimeValue. + */ +public final class SupportedRuntimeValue extends ExpandableStringEnum { + /** Static value Java_8 for SupportedRuntimeValue. */ + public static final SupportedRuntimeValue JAVA_8 = fromString("Java_8"); + + /** Static value Java_11 for SupportedRuntimeValue. */ + public static final SupportedRuntimeValue JAVA_11 = fromString("Java_11"); + + /** Static value NetCore_31 for SupportedRuntimeValue. */ + public static final SupportedRuntimeValue NET_CORE_31 = fromString("NetCore_31"); + + /** + * Creates or finds a SupportedRuntimeValue from its string representation. + * @param name a name to look for + * @return the corresponding SupportedRuntimeValue + */ + @JsonCreator + public static SupportedRuntimeValue fromString(String name) { + return fromString(name, SupportedRuntimeValue.class); + } + + /** + * @return known SupportedRuntimeValue values + */ + public static Collection values() { + return values(SupportedRuntimeValue.class); + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/SupportedRuntimeVersion.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/SupportedRuntimeVersion.java new file mode 100644 index 000000000000..fdbdbc08ff68 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/SupportedRuntimeVersion.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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Supported deployment runtime version descriptor. + */ +public class SupportedRuntimeVersion { + /** + * The raw value which could be passed to deployment CRUD operations. + * Possible values include: 'Java_8', 'Java_11', 'NetCore_31'. + */ + @JsonProperty(value = "value") + private SupportedRuntimeValue 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 SupportedRuntimeValue 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 SupportedRuntimeVersion object itself. + */ + public SupportedRuntimeVersion withValue(SupportedRuntimeValue 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 SupportedRuntimeVersion object itself. + */ + public SupportedRuntimeVersion 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 SupportedRuntimeVersion object itself. + */ + public SupportedRuntimeVersion withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/TemporaryDisk.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/TemporaryDisk.java new file mode 100644 index 000000000000..c4dd796b19a5 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/TemporaryDisk.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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Temporary disk payload. + */ +public class TemporaryDisk { + /** + * Size of the temporary disk in GB. + */ + @JsonProperty(value = "sizeInGB") + private Integer sizeInGB; + + /** + * Mount path of the temporary disk. + */ + @JsonProperty(value = "mountPath") + private String mountPath; + + /** + * Get size of the temporary disk in GB. + * + * @return the sizeInGB value + */ + public Integer sizeInGB() { + return this.sizeInGB; + } + + /** + * Set size of the temporary disk in GB. + * + * @param sizeInGB the sizeInGB value to set + * @return the TemporaryDisk object itself. + */ + public TemporaryDisk withSizeInGB(Integer sizeInGB) { + this.sizeInGB = sizeInGB; + return this; + } + + /** + * Get mount path of the temporary disk. + * + * @return the mountPath value + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set mount path of the temporary disk. + * + * @param mountPath the mountPath value to set + * @return the TemporaryDisk object itself. + */ + public TemporaryDisk withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/TestKeyType.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/TestKeyType.java new file mode 100644 index 000000000000..19b11b8c97e2 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/TestKeyType.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.v2020_11_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TestKeyType. + */ +public final class TestKeyType extends ExpandableStringEnum { + /** Static value Primary for TestKeyType. */ + public static final TestKeyType PRIMARY = fromString("Primary"); + + /** Static value Secondary for TestKeyType. */ + public static final TestKeyType SECONDARY = fromString("Secondary"); + + /** + * Creates or finds a TestKeyType from its string representation. + * @param name a name to look for + * @return the corresponding TestKeyType + */ + @JsonCreator + public static TestKeyType fromString(String name) { + return fromString(name, TestKeyType.class); + } + + /** + * @return known TestKeyType values + */ + public static Collection values() { + return values(TestKeyType.class); + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/TestKeys.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/TestKeys.java new file mode 100644 index 000000000000..907274e24be6 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/TestKeys.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.v2020_11_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.AppPlatformManager; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation.TestKeysInner; + +/** + * Type representing TestKeys. + */ +public interface TestKeys extends HasInner, HasManager { + /** + * @return the enabled value. + */ + Boolean enabled(); + + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the primaryTestEndpoint value. + */ + String primaryTestEndpoint(); + + /** + * @return the secondaryKey value. + */ + String secondaryKey(); + + /** + * @return the secondaryTestEndpoint value. + */ + String secondaryTestEndpoint(); + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/TrafficDirection.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/TrafficDirection.java new file mode 100644 index 000000000000..6d47a903e363 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/TrafficDirection.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.v2020_11_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TrafficDirection. + */ +public final class TrafficDirection extends ExpandableStringEnum { + /** Static value Inbound for TrafficDirection. */ + public static final TrafficDirection INBOUND = fromString("Inbound"); + + /** Static value Outbound for TrafficDirection. */ + public static final TrafficDirection OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a TrafficDirection from its string representation. + * @param name a name to look for + * @return the corresponding TrafficDirection + */ + @JsonCreator + public static TrafficDirection fromString(String name) { + return fromString(name, TrafficDirection.class); + } + + /** + * @return known TrafficDirection values + */ + public static Collection values() { + return values(TrafficDirection.class); + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/UserSourceInfo.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/UserSourceInfo.java new file mode 100644 index 000000000000..864b125d4d4b --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/UserSourceInfo.java @@ -0,0 +1,126 @@ +/** + * 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.v2020_11_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Source information for a deployment. + */ +public class UserSourceInfo { + /** + * Type of the source uploaded. Possible values include: 'Jar', + * 'NetCoreZip', 'Source'. + */ + @JsonProperty(value = "type") + private UserSourceType type; + + /** + * Relative path of the storage which stores the source. + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /** + * Version of the source. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Selector for the artifact to be used for the deployment for multi-module + * projects. This should be + * the relative path to the target module/project. + */ + @JsonProperty(value = "artifactSelector") + private String artifactSelector; + + /** + * Get type of the source uploaded. Possible values include: 'Jar', 'NetCoreZip', 'Source'. + * + * @return the type value + */ + public UserSourceType type() { + return this.type; + } + + /** + * Set type of the source uploaded. Possible values include: 'Jar', 'NetCoreZip', 'Source'. + * + * @param type the type value to set + * @return the UserSourceInfo object itself. + */ + public UserSourceInfo withType(UserSourceType type) { + this.type = type; + return this; + } + + /** + * Get relative path of the storage which stores the source. + * + * @return the relativePath value + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set relative path of the storage which stores the source. + * + * @param relativePath the relativePath value to set + * @return the UserSourceInfo object itself. + */ + public UserSourceInfo withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + + /** + * Get version of the source. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set version of the source. + * + * @param version the version value to set + * @return the UserSourceInfo object itself. + */ + public UserSourceInfo withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get selector for the artifact to be used for the deployment for multi-module projects. This should be + the relative path to the target module/project. + * + * @return the artifactSelector value + */ + public String artifactSelector() { + return this.artifactSelector; + } + + /** + * Set selector for the artifact to be used for the deployment for multi-module projects. This should be + the relative path to the target module/project. + * + * @param artifactSelector the artifactSelector value to set + * @return the UserSourceInfo object itself. + */ + public UserSourceInfo withArtifactSelector(String artifactSelector) { + this.artifactSelector = artifactSelector; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/UserSourceType.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/UserSourceType.java new file mode 100644 index 000000000000..8b3b78d6c92a --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/UserSourceType.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.v2020_11_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UserSourceType. + */ +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"); + + /** + * Creates or finds a UserSourceType from its string representation. + * @param name a name to look for + * @return the corresponding UserSourceType + */ + @JsonCreator + public static UserSourceType fromString(String name) { + return fromString(name, UserSourceType.class); + } + + /** + * @return known UserSourceType values + */ + public static Collection values() { + return values(UserSourceType.class); + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppPlatformManagementClientImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppPlatformManagementClientImpl.java new file mode 100644 index 000000000000..fe54ec9c1b2c --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppPlatformManagementClientImpl.java @@ -0,0 +1,338 @@ +/** + * 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.v2020_11_01_preview.implementation; + +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; + +/** + * Initializes a new instance of the AppPlatformManagementClientImpl class. + */ +public class AppPlatformManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The API version to use for this operation. */ + private String apiVersion; + + /** + * Gets The API version to use for this operation. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AppPlatformManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AppPlatformManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AppPlatformManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AppPlatformManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ServicesInner object to access its operations. + */ + private ServicesInner services; + + /** + * Gets the ServicesInner object to access its operations. + * @return the ServicesInner object. + */ + public ServicesInner services() { + return this.services; + } + + /** + * The ConfigServersInner object to access its operations. + */ + private ConfigServersInner configServers; + + /** + * Gets the ConfigServersInner object to access its operations. + * @return the ConfigServersInner object. + */ + public ConfigServersInner configServers() { + return this.configServers; + } + + /** + * The MonitoringSettingsInner object to access its operations. + */ + private MonitoringSettingsInner monitoringSettings; + + /** + * Gets the MonitoringSettingsInner object to access its operations. + * @return the MonitoringSettingsInner object. + */ + public MonitoringSettingsInner monitoringSettings() { + return this.monitoringSettings; + } + + /** + * The AppsInner object to access its operations. + */ + private AppsInner apps; + + /** + * Gets the AppsInner object to access its operations. + * @return the AppsInner object. + */ + public AppsInner apps() { + return this.apps; + } + + /** + * The BindingsInner object to access its operations. + */ + private BindingsInner bindings; + + /** + * Gets the BindingsInner object to access its operations. + * @return the BindingsInner object. + */ + 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. + */ + private DeploymentsInner deployments; + + /** + * Gets the DeploymentsInner object to access its operations. + * @return the DeploymentsInner object. + */ + public DeploymentsInner deployments() { + return this.deployments; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + 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. + * + * @param credentials the management credentials for Azure + */ + public AppPlatformManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of AppPlatformManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AppPlatformManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AppPlatformManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public AppPlatformManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-11-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.services = new ServicesInner(restClient().retrofit(), this); + this.configServers = new ConfigServersInner(restClient().retrofit(), this); + this.monitoringSettings = new MonitoringSettingsInner(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); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "AppPlatformManagementClient", "2020-11-01-preview"); + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppPlatformManager.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppPlatformManager.java new file mode 100644 index 000000000000..d568fc7c25bc --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppPlatformManager.java @@ -0,0 +1,219 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.Services; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServers; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.MonitoringSettings; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.Apps; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.Bindings; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.Certificates; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.CustomDomains; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.Deployments; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.Operations; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.RuntimeVersions; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.Skus; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure AppPlatform resource management. + */ +public final class AppPlatformManager extends ManagerCore { + private Services services; + private ConfigServers configServers; + private MonitoringSettings monitoringSettings; + private Apps apps; + private Bindings bindings; + private Certificates certificates; + private CustomDomains customDomains; + private Deployments deployments; + private Operations operations; + private RuntimeVersions runtimeVersions; + private Skus skus; + /** + * Get a Configurable instance that can be used to create AppPlatformManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new AppPlatformManager.ConfigurableImpl(); + } + /** + * Creates an instance of AppPlatformManager that exposes AppPlatform resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the AppPlatformManager + */ + public static AppPlatformManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new AppPlatformManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of AppPlatformManager that exposes AppPlatform resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the AppPlatformManager + */ + public static AppPlatformManager authenticate(RestClient restClient, String subscriptionId) { + return new AppPlatformManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of AppPlatformManager that exposes AppPlatform management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing AppPlatform management API entry points that work across subscriptions + */ + AppPlatformManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Services. + */ + public Services services() { + if (this.services == null) { + this.services = new ServicesImpl(this); + } + return this.services; + } + + /** + * @return Entry point to manage ConfigServers. + */ + public ConfigServers configServers() { + if (this.configServers == null) { + this.configServers = new ConfigServersImpl(this); + } + return this.configServers; + } + + /** + * @return Entry point to manage MonitoringSettings. + */ + public MonitoringSettings monitoringSettings() { + if (this.monitoringSettings == null) { + this.monitoringSettings = new MonitoringSettingsImpl(this); + } + return this.monitoringSettings; + } + + /** + * @return Entry point to manage Apps. + */ + public Apps apps() { + if (this.apps == null) { + this.apps = new AppsImpl(this); + } + return this.apps; + } + + /** + * @return Entry point to manage Bindings. + */ + public Bindings bindings() { + if (this.bindings == null) { + this.bindings = new BindingsImpl(this); + } + return this.bindings; + } + + /** + * @return Entry point to manage Certificates. + */ + public Certificates certificates() { + if (this.certificates == null) { + this.certificates = new CertificatesImpl(this); + } + return this.certificates; + } + + /** + * @return Entry point to manage CustomDomains. + */ + public CustomDomains customDomains() { + if (this.customDomains == null) { + this.customDomains = new CustomDomainsImpl(this); + } + return this.customDomains; + } + + /** + * @return Entry point to manage Deployments. + */ + public Deployments deployments() { + if (this.deployments == null) { + this.deployments = new DeploymentsImpl(this); + } + return this.deployments; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage RuntimeVersions. + */ + public RuntimeVersions runtimeVersions() { + if (this.runtimeVersions == null) { + this.runtimeVersions = new RuntimeVersionsImpl(this); + } + return this.runtimeVersions; + } + + /** + * @return Entry point to manage Skus. + */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(this); + } + return this.skus; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public AppPlatformManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return AppPlatformManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private AppPlatformManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new AppPlatformManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppResourceImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppResourceImpl.java new file mode 100644 index 000000000000..85f04dc22c2f --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppResourceImpl.java @@ -0,0 +1,135 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.AppResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.AppResourceProperties; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ManagedIdentityProperties; + +class AppResourceImpl extends CreatableUpdatableImpl implements AppResource, AppResource.Definition, AppResource.Update { + private String resourceGroupName; + private String serviceName; + private String appName; + private final AppPlatformManager manager; + + AppResourceImpl(String name, AppPlatformManager manager) { + super(name, new AppResourceInner()); + this.manager = manager; + // Set resource name + this.appName = name; + // + } + + AppResourceImpl(AppResourceInner inner, AppPlatformManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.appName = 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"); + // set other parameters for create and update + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + AppsInner client = this.manager().inner().apps(); + 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.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AppsInner client = this.manager().inner().apps(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @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(); + } + + @Override + public AppResourceProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public AppResourceImpl withResourceGroupName(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + @Override + public AppResourceImpl withServiceName(String serviceName) { + this.serviceName = 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) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppResourceInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppResourceInner.java new file mode 100644 index 000000000000..6c09f597e19b --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppResourceInner.java @@ -0,0 +1,99 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.AppResourceProperties; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ManagedIdentityProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * App resource payload. + */ +public class AppResourceInner extends ProxyResource { + /** + * Properties of the App resource. + */ + @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. + * + * @return the properties value + */ + public AppResourceProperties properties() { + return this.properties; + } + + /** + * Set properties of the App resource. + * + * @param properties the properties value to set + * @return the AppResourceInner object itself. + */ + public AppResourceInner withProperties(AppResourceProperties properties) { + this.properties = 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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppsImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppsImpl.java new file mode 100644 index 000000000000..54fe5718a4ff --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppsImpl.java @@ -0,0 +1,107 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.Apps; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.AppResource; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ResourceUploadDefinition; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.CustomDomainValidateResult; + +class AppsImpl extends WrapperImpl implements Apps { + private final AppPlatformManager manager; + + AppsImpl(AppPlatformManager manager) { + super(manager.inner().apps()); + this.manager = manager; + } + + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public AppResourceImpl define(String name) { + return wrapModel(name); + } + + private AppResourceImpl wrapModel(AppResourceInner inner) { + return new AppResourceImpl(inner, manager()); + } + + private AppResourceImpl wrapModel(String name) { + return new AppResourceImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String serviceName, String appName) { + AppsInner client = this.inner(); + return client.getAsync(resourceGroupName, serviceName, appName) + .map(new Func1() { + @Override + public AppResource call(AppResourceInner inner) { + return new AppResourceImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serviceName, String appName) { + AppsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serviceName, appName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String serviceName) { + AppsInner 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 AppResource call(AppResourceInner inner) { + return new AppResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable getResourceUploadUrlAsync(String resourceGroupName, String serviceName, String appName) { + AppsInner client = this.inner(); + return client.getResourceUploadUrlAsync(resourceGroupName, serviceName, appName) + .map(new Func1() { + @Override + public ResourceUploadDefinition call(ResourceUploadDefinitionInner inner) { + return new ResourceUploadDefinitionImpl(inner, manager()); + } + }); + } + + @Override + public Observable validateDomainAsync(String resourceGroupName, String serviceName, String appName, String name) { + AppsInner client = this.inner(); + return client.validateDomainAsync(resourceGroupName, serviceName, appName, name) + .map(new Func1() { + @Override + public CustomDomainValidateResult call(CustomDomainValidateResultInner inner) { + return new CustomDomainValidateResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppsInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppsInner.java new file mode 100644 index 000000000000..ab6306110073 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AppsInner.java @@ -0,0 +1,1268 @@ +/** + * 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.v2020_11_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.v2020_11_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 Apps. + */ +public class AppsInner { + /** The Retrofit service to perform REST calls. */ + private AppsService service; + /** The service client containing this operation class. */ + private AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of AppsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AppsInner(Retrofit retrofit, AppPlatformManagementClientImpl client) { + this.service = retrofit.create(AppsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Apps to be + * used by Retrofit to perform actually REST calls. + */ + interface AppsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_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("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.v2020_11_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, @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.v2020_11_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.v2020_11_01_preview.Apps delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", method = "DELETE", hasBody = true) + Observable> delete(@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.v2020_11_01_preview.Apps beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@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.v2020_11_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, @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.v2020_11_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.v2020_11_01_preview.Apps list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps") + 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.v2020_11_01_preview.Apps getResourceUploadUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl") + Observable> getResourceUploadUrl(@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.v2020_11_01_preview.Apps validateDomain" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain") + Observable> validateDomain(@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.v2020_11_01_preview.Apps listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get an App and its properties. + * + * @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 AppResourceInner object if successful. + */ + public AppResourceInner get(String resourceGroupName, String serviceName, String appName) { + return getWithServiceResponseAsync(resourceGroupName, serviceName, appName).toBlocking().single().body(); + } + + /** + * Get an App and its properties. + * + * @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 getAsync(String resourceGroupName, String serviceName, String appName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serviceName, appName), serviceCallback); + } + + /** + * Get an App and its properties. + * + * @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 AppResourceInner object + */ + public Observable getAsync(String resourceGroupName, String serviceName, String appName) { + return getWithServiceResponseAsync(resourceGroupName, serviceName, appName).map(new Func1, AppResourceInner>() { + @Override + public AppResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an App and its properties. + * + * @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 AppResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serviceName, 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String syncStatus = null; + 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) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get an App and its properties. + * + * @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 syncStatus Indicates whether sync status + * @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 get(String resourceGroupName, String serviceName, String appName, String syncStatus) { + return getWithServiceResponseAsync(resourceGroupName, serviceName, appName, syncStatus).toBlocking().single().body(); + } + + /** + * Get an App and its properties. + * + * @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 syncStatus Indicates whether sync status + * @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 syncStatus, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serviceName, appName, syncStatus), serviceCallback); + } + + /** + * Get an App and its properties. + * + * @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 syncStatus Indicates whether sync status + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppResourceInner object + */ + public Observable getAsync(String resourceGroupName, String serviceName, String appName, String syncStatus) { + return getWithServiceResponseAsync(resourceGroupName, serviceName, appName, syncStatus).map(new Func1, AppResourceInner>() { + @Override + public AppResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an App and its properties. + * + * @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 syncStatus Indicates whether sync status + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String syncStatus) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + 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) { + 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 a new App or update an exiting App. + * + * @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, AppResourceInner appResource) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).toBlocking().last().body(); + } + + /** + * Create a new App or update an exiting App. + * + * @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, AppResourceInner appResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource), serviceCallback); + } + + /** + * Create a new App or update an exiting App. + * + * @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 for the request + */ + 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(); + } + }); + } + + /** + * Create a new App or update an exiting App. + * + * @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 for the request + */ + 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."); + } + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + 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()); + } + + /** + * Create a new App or update an exiting App. + * + * @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 beginCreateOrUpdate(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).toBlocking().single().body(); + } + + /** + * Create a new App or update an exiting App. + * + * @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 beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource), serviceCallback); + } + + /** + * Create a new App or update an exiting App. + * + * @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 + */ + 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(); + } + }); + } + + /** + * Create a new App or update an exiting App. + * + * @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 + */ + 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."); + } + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (appResource == null) { + throw new IllegalArgumentException("Parameter appResource is required and cannot be null."); + } + 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 = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Operation to delete an App. + * + * @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 + */ + public void delete(String resourceGroupName, String serviceName, String appName) { + deleteWithServiceResponseAsync(resourceGroupName, serviceName, appName).toBlocking().last().body(); + } + + /** + * Operation to delete an App. + * + * @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 deleteAsync(String resourceGroupName, String serviceName, String appName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceName, appName), serviceCallback); + } + + /** + * Operation to delete an App. + * + * @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 + */ + public Observable deleteAsync(String resourceGroupName, String serviceName, String appName) { + return deleteWithServiceResponseAsync(resourceGroupName, serviceName, appName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to delete an App. + * + * @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 + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serviceName, 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Operation to delete an App. + * + * @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 + */ + public void beginDelete(String resourceGroupName, String serviceName, String appName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName, appName).toBlocking().single().body(); + } + + /** + * Operation to delete an App. + * + * @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 beginDeleteAsync(String resourceGroupName, String serviceName, String appName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName, appName), serviceCallback); + } + + /** + * Operation to delete an App. + * + * @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 {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serviceName, String appName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName, appName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to delete an App. + * + * @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 {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serviceName, 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(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 clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(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()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Operation to update an exiting App. + * + * @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, AppResourceInner appResource) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).toBlocking().last().body(); + } + + /** + * Operation to update an exiting App. + * + * @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, AppResourceInner appResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource), serviceCallback); + } + + /** + * Operation to update an exiting App. + * + * @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 for the request + */ + 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(); + } + }); + } + + /** + * Operation to update an exiting App. + * + * @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 for the request + */ + 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."); + } + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + 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()); + } + + /** + * Operation to update an exiting App. + * + * @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 beginUpdate(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).toBlocking().single().body(); + } + + /** + * Operation to update an exiting App. + * + * @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 beginUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource), serviceCallback); + } + + /** + * Operation to update an exiting App. + * + * @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 + */ + 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(); + } + }); + } + + /** + * Operation to update an exiting App. + * + * @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 + */ + 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."); + } + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (appResource == null) { + throw new IllegalArgumentException("Parameter appResource is required and cannot be null."); + } + 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 = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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); + } + + /** + * Handles requests to list all resources in a 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 PagedList<AppResourceInner> 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(); + } + }; + } + + /** + * Handles requests to list all resources in a 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> 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); + } + + /** + * Handles requests to list all resources in a 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 PagedList<AppResourceInner> 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(); + } + }); + } + + /** + * Handles requests to list all resources in a 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 PagedList<AppResourceInner> 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)); + } + }); + } + + /** + * Handles requests to list all resources in a Service. + * + 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<AppResourceInner> 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @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 ResourceUploadDefinitionInner object if successful. + */ + public ResourceUploadDefinitionInner getResourceUploadUrl(String resourceGroupName, String serviceName, String appName) { + return getResourceUploadUrlWithServiceResponseAsync(resourceGroupName, serviceName, appName).toBlocking().single().body(); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @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 getResourceUploadUrlAsync(String resourceGroupName, String serviceName, String appName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getResourceUploadUrlWithServiceResponseAsync(resourceGroupName, serviceName, appName), serviceCallback); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @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 ResourceUploadDefinitionInner object + */ + public Observable getResourceUploadUrlAsync(String resourceGroupName, String serviceName, String appName) { + return getResourceUploadUrlWithServiceResponseAsync(resourceGroupName, serviceName, appName).map(new Func1, ResourceUploadDefinitionInner>() { + @Override + public ResourceUploadDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @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 ResourceUploadDefinitionInner object + */ + public Observable> getResourceUploadUrlWithServiceResponseAsync(String resourceGroupName, String serviceName, 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getResourceUploadUrl(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 clientResponse = getResourceUploadUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getResourceUploadUrlDelegate(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); + } + + /** + * 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 validateDomain(String resourceGroupName, String serviceName, String appName, String name) { + return validateDomainWithServiceResponseAsync(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 validateDomainAsync(String resourceGroupName, String serviceName, String appName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateDomainWithServiceResponseAsync(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 validateDomainAsync(String resourceGroupName, String serviceName, String appName, String name) { + return validateDomainWithServiceResponseAsync(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> validateDomainWithServiceResponseAsync(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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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.validateDomain(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 = validateDomainDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse validateDomainDelegate(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); + } + + /** + * Handles requests to list all resources in a Service. + * + * @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<AppResourceInner> 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(); + } + }; + } + + /** + * Handles requests to list all resources in a Service. + * + * @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); + } + + /** + * Handles requests to list all resources in a Service. + * + * @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<AppResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Handles requests to list all resources in a Service. + * + * @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<AppResourceInner> 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)); + } + }); + } + + /** + * Handles requests to list all resources in a Service. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AppResourceInner> 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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AvailableRuntimeVersionsImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AvailableRuntimeVersionsImpl.java new file mode 100644 index 000000000000..73f57042bcc2 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.AvailableRuntimeVersions; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.SupportedRuntimeVersion; + +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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AvailableRuntimeVersionsInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/AvailableRuntimeVersionsInner.java new file mode 100644 index 000000000000..16b0ccbe4a8a --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.SupportedRuntimeVersion; +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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/BindingResourceImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/BindingResourceImpl.java new file mode 100644 index 000000000000..0656d6534b42 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/BindingResourceImpl.java @@ -0,0 +1,139 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.BindingResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.BindingResourceProperties; +import java.util.Map; +import rx.functions.Func1; + +class BindingResourceImpl extends CreatableUpdatableImpl implements BindingResource, BindingResource.Definition, BindingResource.Update { + private final AppPlatformManager manager; + private String resourceGroupName; + private String serviceName; + private String appName; + private String bindingName; + private BindingResourceProperties cproperties; + private BindingResourceProperties uproperties; + + BindingResourceImpl(String name, AppPlatformManager manager) { + super(name, new BindingResourceInner()); + this.manager = manager; + // Set resource name + this.bindingName = name; + // + this.cproperties = new BindingResourceProperties(); + this.uproperties = new BindingResourceProperties(); + } + + BindingResourceImpl(BindingResourceInner inner, AppPlatformManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.bindingName = 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.bindingName = IdParsingUtils.getValueFromIdByName(inner.id(), "bindings"); + // + this.cproperties = new BindingResourceProperties(); + this.uproperties = new BindingResourceProperties(); + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BindingsInner client = this.manager().inner().bindings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serviceName, this.appName, this.bindingName, this.cproperties) + .map(new Func1() { + @Override + public BindingResourceInner call(BindingResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BindingsInner client = this.manager().inner().bindings(); + return client.updateAsync(this.resourceGroupName, this.serviceName, this.appName, this.bindingName, this.uproperties) + .map(new Func1() { + @Override + public BindingResourceInner call(BindingResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BindingsInner client = this.manager().inner().bindings(); + return client.getAsync(this.resourceGroupName, this.serviceName, this.appName, this.bindingName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.cproperties = new BindingResourceProperties(); + this.uproperties = new BindingResourceProperties(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public BindingResourceProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public BindingResourceImpl withExistingApp(String resourceGroupName, String serviceName, String appName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.appName = appName; + return this; + } + + @Override + public BindingResourceImpl withProperties(BindingResourceProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/BindingResourceInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/BindingResourceInner.java new file mode 100644 index 000000000000..eb340185ee74 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/BindingResourceInner.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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.BindingResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * Binding resource payload. + */ +public class BindingResourceInner extends ProxyResource { + /** + * Properties of the Binding resource. + */ + @JsonProperty(value = "properties") + private BindingResourceProperties properties; + + /** + * Get properties of the Binding resource. + * + * @return the properties value + */ + public BindingResourceProperties properties() { + return this.properties; + } + + /** + * Set properties of the Binding resource. + * + * @param properties the properties value to set + * @return the BindingResourceInner object itself. + */ + public BindingResourceInner withProperties(BindingResourceProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/BindingsImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/BindingsImpl.java new file mode 100644 index 000000000000..a083f28be38f --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/BindingsImpl.java @@ -0,0 +1,85 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.Bindings; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.BindingResource; + +class BindingsImpl extends WrapperImpl implements Bindings { + private final AppPlatformManager manager; + + BindingsImpl(AppPlatformManager manager) { + super(manager.inner().bindings()); + this.manager = manager; + } + + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public BindingResourceImpl define(String name) { + return wrapModel(name); + } + + private BindingResourceImpl wrapModel(BindingResourceInner inner) { + return new BindingResourceImpl(inner, manager()); + } + + private BindingResourceImpl wrapModel(String name) { + return new BindingResourceImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String serviceName, final String appName) { + BindingsInner 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 BindingResource call(BindingResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + BindingsInner client = this.inner(); + return client.getAsync(resourceGroupName, serviceName, appName, bindingName) + .flatMap(new Func1>() { + @Override + public Observable call(BindingResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((BindingResource)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + BindingsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serviceName, appName, bindingName).toCompletable(); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/BindingsInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/BindingsInner.java new file mode 100644 index 000000000000..9f321927c0e4 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/BindingsInner.java @@ -0,0 +1,1388 @@ +/** + * 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.v2020_11_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.v2020_11_01_preview.BindingResourceProperties; +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.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 Bindings. + */ +public class BindingsInner { + /** The Retrofit service to perform REST calls. */ + private BindingsService service; + /** The service client containing this operation class. */ + private AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of BindingsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BindingsInner(Retrofit retrofit, AppPlatformManagementClientImpl client) { + this.service = retrofit.create(BindingsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Bindings to be + * used by Retrofit to perform actually REST calls. + */ + interface BindingsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.Bindings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("bindingName") String bindingName, @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.v2020_11_01_preview.Bindings createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("bindingName") String bindingName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BindingResourceInner bindingResource, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.Bindings beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("bindingName") String bindingName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BindingResourceInner bindingResource, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.Bindings delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("bindingName") String bindingName, @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.v2020_11_01_preview.Bindings beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("bindingName") String bindingName, @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.v2020_11_01_preview.Bindings update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("bindingName") String bindingName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BindingResourceInner bindingResource, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.Bindings beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("bindingName") String bindingName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BindingResourceInner bindingResource, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.Bindings list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings") + 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.v2020_11_01_preview.Bindings listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a Binding and its properties. + * + * @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 bindingName The name of the Binding 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 BindingResourceInner object if successful. + */ + public BindingResourceInner get(String resourceGroupName, String serviceName, String appName, String bindingName) { + return getWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName).toBlocking().single().body(); + } + + /** + * Get a Binding and its properties. + * + * @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 bindingName The name of the Binding 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 bindingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName), serviceCallback); + } + + /** + * Get a Binding and its properties. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BindingResourceInner object + */ + public Observable getAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + return getWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName).map(new Func1, BindingResourceInner>() { + @Override + public BindingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Binding and its properties. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BindingResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + 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 (bindingName == null) { + throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, 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 a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding 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 BindingResourceInner object if successful. + */ + public BindingResourceInner createOrUpdate(String resourceGroupName, String serviceName, String appName, String bindingName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName).toBlocking().last().body(); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding 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 bindingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName), serviceCallback); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName).map(new Func1, BindingResourceInner>() { + @Override + public BindingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + 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 (bindingName == null) { + throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final BindingResourceProperties properties = null; + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(null); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, this.client.apiVersion(), this.client.acceptLanguage(), bindingResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Create a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding 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 BindingResourceInner object if successful. + */ + public BindingResourceInner createOrUpdate(String resourceGroupName, String serviceName, String appName, String bindingName, BindingResourceProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties).toBlocking().last().body(); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding 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 bindingName, BindingResourceProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties), serviceCallback); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String bindingName, BindingResourceProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties).map(new Func1, BindingResourceInner>() { + @Override + public BindingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String bindingName, BindingResourceProperties 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 (bindingName == null) { + throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, this.client.apiVersion(), this.client.acceptLanguage(), bindingResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding 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 BindingResourceInner object if successful. + */ + public BindingResourceInner beginCreateOrUpdate(String resourceGroupName, String serviceName, String appName, String bindingName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName).toBlocking().single().body(); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding 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, String appName, String bindingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName), serviceCallback); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BindingResourceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName).map(new Func1, BindingResourceInner>() { + @Override + public BindingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BindingResourceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + 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 (bindingName == null) { + throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final BindingResourceProperties properties = null; + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(null); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, this.client.apiVersion(), this.client.acceptLanguage(), bindingResource, 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 Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding 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 BindingResourceInner object if successful. + */ + public BindingResourceInner beginCreateOrUpdate(String resourceGroupName, String serviceName, String appName, String bindingName, BindingResourceProperties properties) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties).toBlocking().single().body(); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding 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, String appName, String bindingName, BindingResourceProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties), serviceCallback); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BindingResourceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String bindingName, BindingResourceProperties properties) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties).map(new Func1, BindingResourceInner>() { + @Override + public BindingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BindingResourceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String bindingName, BindingResourceProperties 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 (bindingName == null) { + throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, this.client.apiVersion(), this.client.acceptLanguage(), bindingResource, 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); + } + } + }); + } + + 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Operation to delete a Binding. + * + * @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 bindingName The name of the Binding 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 bindingName) { + deleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName).toBlocking().last().body(); + } + + /** + * Operation to delete a Binding. + * + * @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 bindingName The name of the Binding 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 bindingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName), serviceCallback); + } + + /** + * Operation to delete a Binding. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + return deleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to delete a Binding. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + 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 (bindingName == null) { + throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Operation to delete a Binding. + * + * @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 bindingName The name of the Binding 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 beginDelete(String resourceGroupName, String serviceName, String appName, String bindingName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName).toBlocking().single().body(); + } + + /** + * Operation to delete a Binding. + * + * @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 bindingName The name of the Binding 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 beginDeleteAsync(String resourceGroupName, String serviceName, String appName, String bindingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName), serviceCallback); + } + + /** + * Operation to delete a Binding. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to delete a Binding. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + 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 (bindingName == null) { + throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(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()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding 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 BindingResourceInner object if successful. + */ + public BindingResourceInner update(String resourceGroupName, String serviceName, String appName, String bindingName) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName).toBlocking().last().body(); + } + + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding 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, String appName, String bindingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName), serviceCallback); + } + + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName).map(new Func1, BindingResourceInner>() { + @Override + public BindingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + 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 (bindingName == null) { + throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final BindingResourceProperties properties = null; + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(null); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, this.client.apiVersion(), this.client.acceptLanguage(), bindingResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding 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 BindingResourceInner object if successful. + */ + public BindingResourceInner update(String resourceGroupName, String serviceName, String appName, String bindingName, BindingResourceProperties properties) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties).toBlocking().last().body(); + } + + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding 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, String appName, String bindingName, BindingResourceProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties), serviceCallback); + } + + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String serviceName, String appName, String bindingName, BindingResourceProperties properties) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties).map(new Func1, BindingResourceInner>() { + @Override + public BindingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String bindingName, BindingResourceProperties 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 (bindingName == null) { + throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, this.client.apiVersion(), this.client.acceptLanguage(), bindingResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding 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 BindingResourceInner object if successful. + */ + public BindingResourceInner beginUpdate(String resourceGroupName, String serviceName, String appName, String bindingName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName).toBlocking().single().body(); + } + + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding 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, String appName, String bindingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName), serviceCallback); + } + + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BindingResourceInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName).map(new Func1, BindingResourceInner>() { + @Override + public BindingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BindingResourceInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + 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 (bindingName == null) { + throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final BindingResourceProperties properties = null; + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(null); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, this.client.apiVersion(), this.client.acceptLanguage(), bindingResource, 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 Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding 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 BindingResourceInner object if successful. + */ + public BindingResourceInner beginUpdate(String resourceGroupName, String serviceName, String appName, String bindingName, BindingResourceProperties properties) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties).toBlocking().single().body(); + } + + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding 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, String appName, String bindingName, BindingResourceProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties), serviceCallback); + } + + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BindingResourceInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String serviceName, String appName, String bindingName, BindingResourceProperties properties) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties).map(new Func1, BindingResourceInner>() { + @Override + public BindingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to update an exiting Binding. + * + * @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 bindingName The name of the Binding resource. + * @param properties Properties of the Binding resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BindingResourceInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String bindingName, BindingResourceProperties 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 (bindingName == null) { + throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, this.client.apiVersion(), this.client.acceptLanguage(), bindingResource, 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); + } + } + }); + } + + 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); + } + + /** + * Handles requests to list all resources in an App. + * + * @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<BindingResourceInner> 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(); + } + }; + } + + /** + * Handles requests to list all resources in an App. + * + * @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); + } + + /** + * Handles requests to list all resources in an App. + * + * @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<BindingResourceInner> 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(); + } + }); + } + + /** + * Handles requests to list all resources in an App. + * + * @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<BindingResourceInner> 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)); + } + }); + } + + /** + * Handles requests to list all resources in an App. + * + 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<BindingResourceInner> 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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); + } + + /** + * Handles requests to list all resources in an App. + * + * @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<BindingResourceInner> 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(); + } + }; + } + + /** + * Handles requests to list all resources in an App. + * + * @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); + } + + /** + * Handles requests to list all resources in an App. + * + * @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<BindingResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Handles requests to list all resources in an App. + * + * @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<BindingResourceInner> 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)); + } + }); + } + + /** + * Handles requests to list all resources in an App. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BindingResourceInner> 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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CertificateResourceImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CertificateResourceImpl.java new file mode 100644 index 000000000000..cd6010ce6b6f --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.CertificateResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CertificateResourceInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CertificateResourceInner.java new file mode 100644 index 000000000000..98cdbffaea58 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CertificatesImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CertificatesImpl.java new file mode 100644 index 000000000000..897d14421159 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.Certificates; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.appplatform.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CertificatesInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CertificatesInner.java new file mode 100644 index 000000000000..e59a191f54ad --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CertificatesInner.java @@ -0,0 +1,943 @@ +/** + * 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.v2020_11_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.v2020_11_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.v2020_11_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.v2020_11_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.v2020_11_01_preview.Certificates beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}") + Observable> beginCreateOrUpdate(@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.v2020_11_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.v2020_11_01_preview.Certificates beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@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.v2020_11_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.v2020_11_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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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().last().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 for the request + */ + 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 for the request + */ + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final CertificateProperties properties = null; + CertificateResourceInner certificateResource = new CertificateResourceInner(); + certificateResource.withProperties(null); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, certificateName, this.client.apiVersion(), this.client.acceptLanguage(), certificateResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * 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().last().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 for the request + */ + 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 for the request + */ + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + CertificateResourceInner certificateResource = new CertificateResourceInner(); + certificateResource.withProperties(properties); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, certificateName, this.client.apiVersion(), this.client.acceptLanguage(), certificateResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 beginCreateOrUpdate(String resourceGroupName, String serviceName, String certificateName) { + return beginCreateOrUpdateWithServiceResponseAsync(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 beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(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 beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String certificateName) { + return beginCreateOrUpdateWithServiceResponseAsync(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> beginCreateOrUpdateWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final CertificateProperties properties = null; + CertificateResourceInner certificateResource = new CertificateResourceInner(); + certificateResource.withProperties(null); + return service.beginCreateOrUpdate(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 = beginCreateOrUpdateDelegate(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 beginCreateOrUpdate(String resourceGroupName, String serviceName, String certificateName, CertificateProperties properties) { + return beginCreateOrUpdateWithServiceResponseAsync(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 beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String certificateName, CertificateProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(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 beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String certificateName, CertificateProperties properties) { + return beginCreateOrUpdateWithServiceResponseAsync(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> beginCreateOrUpdateWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + CertificateResourceInner certificateResource = new CertificateResourceInner(); + certificateResource.withProperties(properties); + return service.beginCreateOrUpdate(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 = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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()) + .register(202, 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().last().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 observable for the request + */ + 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 observable for the request + */ + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, serviceName, certificateName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 beginDelete(String resourceGroupName, String serviceName, String certificateName) { + beginDeleteWithServiceResponseAsync(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 beginDeleteAsync(String resourceGroupName, String serviceName, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(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 beginDeleteAsync(String resourceGroupName, String serviceName, String certificateName) { + return beginDeleteWithServiceResponseAsync(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> beginDeleteWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(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 = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(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()) + .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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServerResourceImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServerResourceImpl.java new file mode 100644 index 000000000000..0166dc562701 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServerResourceImpl.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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServerResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServerProperties; + +class ConfigServerResourceImpl extends WrapperImpl implements ConfigServerResource { + private final AppPlatformManager manager; + ConfigServerResourceImpl(ConfigServerResourceInner inner, AppPlatformManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ConfigServerProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServerResourceInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServerResourceInner.java new file mode 100644 index 000000000000..56eaf095cdee --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServerResourceInner.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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServerProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * Config Server resource. + */ +public class ConfigServerResourceInner extends ProxyResource { + /** + * Properties of the Config Server resource. + */ + @JsonProperty(value = "properties") + private ConfigServerProperties properties; + + /** + * Get properties of the Config Server resource. + * + * @return the properties value + */ + public ConfigServerProperties properties() { + return this.properties; + } + + /** + * Set properties of the Config Server resource. + * + * @param properties the properties value to set + * @return the ConfigServerResourceInner object itself. + */ + public ConfigServerResourceInner withProperties(ConfigServerProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServerSettingsValidateResultImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServerSettingsValidateResultImpl.java new file mode 100644 index 000000000000..ea968a033503 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServerSettingsValidateResultImpl.java @@ -0,0 +1,38 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServerSettingsValidateResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServerSettingsErrorRecord; + +class ConfigServerSettingsValidateResultImpl extends WrapperImpl implements ConfigServerSettingsValidateResult { + private final AppPlatformManager manager; + ConfigServerSettingsValidateResultImpl(ConfigServerSettingsValidateResultInner inner, AppPlatformManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public List details() { + return this.inner().details(); + } + + @Override + public Boolean isValid() { + return this.inner().isValid(); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServerSettingsValidateResultInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServerSettingsValidateResultInner.java new file mode 100644 index 000000000000..31a61cea8980 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServerSettingsValidateResultInner.java @@ -0,0 +1,71 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServerSettingsErrorRecord; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Validation result for config server settings. + */ +public class ConfigServerSettingsValidateResultInner { + /** + * Indicate if the config server settings are valid. + */ + @JsonProperty(value = "isValid") + private Boolean isValid; + + /** + * The detail validation results. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get indicate if the config server settings are valid. + * + * @return the isValid value + */ + public Boolean isValid() { + return this.isValid; + } + + /** + * Set indicate if the config server settings are valid. + * + * @param isValid the isValid value to set + * @return the ConfigServerSettingsValidateResultInner object itself. + */ + public ConfigServerSettingsValidateResultInner withIsValid(Boolean isValid) { + this.isValid = isValid; + return this; + } + + /** + * Get the detail validation results. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set the detail validation results. + * + * @param details the details value to set + * @return the ConfigServerSettingsValidateResultInner object itself. + */ + public ConfigServerSettingsValidateResultInner withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServersImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServersImpl.java new file mode 100644 index 000000000000..68f9ecf61594 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServersImpl.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServers; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServerResource; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServerSettingsValidateResult; + +class ConfigServersImpl extends WrapperImpl implements ConfigServers { + private final AppPlatformManager manager; + + ConfigServersImpl(AppPlatformManager manager) { + super(manager.inner().configServers()); + this.manager = manager; + } + + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String resourceGroupName, String serviceName) { + ConfigServersInner client = this.inner(); + return client.getAsync(resourceGroupName, serviceName) + .map(new Func1() { + @Override + public ConfigServerResource call(ConfigServerResourceInner inner) { + return new ConfigServerResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable updatePutAsync(String resourceGroupName, String serviceName) { + ConfigServersInner client = this.inner(); + return client.updatePutAsync(resourceGroupName, serviceName) + .map(new Func1() { + @Override + public ConfigServerResource call(ConfigServerResourceInner inner) { + return new ConfigServerResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable updatePatchAsync(String resourceGroupName, String serviceName) { + ConfigServersInner client = this.inner(); + return client.updatePatchAsync(resourceGroupName, serviceName) + .map(new Func1() { + @Override + public ConfigServerResource call(ConfigServerResourceInner inner) { + return new ConfigServerResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable validateAsync(String resourceGroupName, String serviceName) { + ConfigServersInner client = this.inner(); + return client.validateAsync(resourceGroupName, serviceName) + .map(new Func1() { + @Override + public ConfigServerSettingsValidateResult call(ConfigServerSettingsValidateResultInner inner) { + return new ConfigServerSettingsValidateResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServersInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServersInner.java new file mode 100644 index 000000000000..32fe479ba5da --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ConfigServersInner.java @@ -0,0 +1,1149 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServerGitProperty; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServerProperties; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServerSettings; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in ConfigServers. + */ +public class ConfigServersInner { + /** The Retrofit service to perform REST calls. */ + private ConfigServersService service; + /** The service client containing this operation class. */ + private AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of ConfigServersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ConfigServersInner(Retrofit retrofit, AppPlatformManagementClientImpl client) { + this.service = retrofit.create(ConfigServersService.class); + this.client = client; + } + + /** + * The interface defining all the services for ConfigServers to be + * used by Retrofit to perform actually REST calls. + */ + interface ConfigServersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServers get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default") + Observable> get(@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.v2020_11_01_preview.ConfigServers updatePut" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default") + Observable> updatePut(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConfigServerResourceInner configServerResource, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServers beginUpdatePut" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default") + Observable> beginUpdatePut(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConfigServerResourceInner configServerResource, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServers updatePatch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default") + Observable> updatePatch(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConfigServerResourceInner configServerResource, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServers beginUpdatePatch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default") + Observable> beginUpdatePatch(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConfigServerResourceInner configServerResource, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServers validate" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate") + Observable> validate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConfigServerSettings configServerSettings, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.ConfigServers beginValidate" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate") + Observable> beginValidate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConfigServerSettings configServerSettings, @Header("User-Agent") String userAgent); + + } + + /** + * Get the config server and its properties. + * + * @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 ConfigServerResourceInner object if successful. + */ + public ConfigServerResourceInner get(String resourceGroupName, String serviceName) { + return getWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); + } + + /** + * Get the config server and its properties. + * + * @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 getAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Get the config server and its properties. + * + * @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 ConfigServerResourceInner object + */ + public Observable getAsync(String resourceGroupName, String serviceName) { + return getWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ConfigServerResourceInner>() { + @Override + public ConfigServerResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the config server and its properties. + * + * @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 ConfigServerResourceInner object + */ + public Observable> getWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(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 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); + } + + /** + * Update the config server. + * + * @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 ConfigServerResourceInner object if successful. + */ + public ConfigServerResourceInner updatePut(String resourceGroupName, String serviceName) { + return updatePutWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().last().body(); + } + + /** + * Update the config server. + * + * @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 updatePutAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updatePutWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Update the config server. + * + * @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 updatePutAsync(String resourceGroupName, String serviceName) { + return updatePutWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ConfigServerResourceInner>() { + @Override + public ConfigServerResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the config server. + * + * @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> updatePutWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final ConfigServerProperties properties = null; + ConfigServerResourceInner configServerResource = new ConfigServerResourceInner(); + configServerResource.withProperties(null); + Observable> observable = service.updatePut(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), configServerResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Update the config server. + * + * @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 properties Properties of the Config Server 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 ConfigServerResourceInner object if successful. + */ + public ConfigServerResourceInner updatePut(String resourceGroupName, String serviceName, ConfigServerProperties properties) { + return updatePutWithServiceResponseAsync(resourceGroupName, serviceName, properties).toBlocking().last().body(); + } + + /** + * Update the config server. + * + * @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 properties Properties of the Config Server 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 updatePutAsync(String resourceGroupName, String serviceName, ConfigServerProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updatePutWithServiceResponseAsync(resourceGroupName, serviceName, properties), serviceCallback); + } + + /** + * Update the config server. + * + * @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 properties Properties of the Config Server resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updatePutAsync(String resourceGroupName, String serviceName, ConfigServerProperties properties) { + return updatePutWithServiceResponseAsync(resourceGroupName, serviceName, properties).map(new Func1, ConfigServerResourceInner>() { + @Override + public ConfigServerResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the config server. + * + * @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 properties Properties of the Config Server resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updatePutWithServiceResponseAsync(String resourceGroupName, String serviceName, ConfigServerProperties 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + ConfigServerResourceInner configServerResource = new ConfigServerResourceInner(); + configServerResource.withProperties(properties); + Observable> observable = service.updatePut(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), configServerResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update the config server. + * + * @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 ConfigServerResourceInner object if successful. + */ + public ConfigServerResourceInner beginUpdatePut(String resourceGroupName, String serviceName) { + return beginUpdatePutWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); + } + + /** + * Update the config server. + * + * @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 beginUpdatePutAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdatePutWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Update the config server. + * + * @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 ConfigServerResourceInner object + */ + public Observable beginUpdatePutAsync(String resourceGroupName, String serviceName) { + return beginUpdatePutWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ConfigServerResourceInner>() { + @Override + public ConfigServerResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the config server. + * + * @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 ConfigServerResourceInner object + */ + public Observable> beginUpdatePutWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final ConfigServerProperties properties = null; + ConfigServerResourceInner configServerResource = new ConfigServerResourceInner(); + configServerResource.withProperties(null); + return service.beginUpdatePut(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), configServerResource, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdatePutDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update the config server. + * + * @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 properties Properties of the Config Server 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 ConfigServerResourceInner object if successful. + */ + public ConfigServerResourceInner beginUpdatePut(String resourceGroupName, String serviceName, ConfigServerProperties properties) { + return beginUpdatePutWithServiceResponseAsync(resourceGroupName, serviceName, properties).toBlocking().single().body(); + } + + /** + * Update the config server. + * + * @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 properties Properties of the Config Server 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 beginUpdatePutAsync(String resourceGroupName, String serviceName, ConfigServerProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdatePutWithServiceResponseAsync(resourceGroupName, serviceName, properties), serviceCallback); + } + + /** + * Update the config server. + * + * @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 properties Properties of the Config Server resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigServerResourceInner object + */ + public Observable beginUpdatePutAsync(String resourceGroupName, String serviceName, ConfigServerProperties properties) { + return beginUpdatePutWithServiceResponseAsync(resourceGroupName, serviceName, properties).map(new Func1, ConfigServerResourceInner>() { + @Override + public ConfigServerResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the config server. + * + * @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 properties Properties of the Config Server resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigServerResourceInner object + */ + public Observable> beginUpdatePutWithServiceResponseAsync(String resourceGroupName, String serviceName, ConfigServerProperties 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + ConfigServerResourceInner configServerResource = new ConfigServerResourceInner(); + configServerResource.withProperties(properties); + return service.beginUpdatePut(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), configServerResource, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdatePutDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdatePutDelegate(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); + } + + /** + * Update the config server. + * + * @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 ConfigServerResourceInner object if successful. + */ + public ConfigServerResourceInner updatePatch(String resourceGroupName, String serviceName) { + return updatePatchWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().last().body(); + } + + /** + * Update the config server. + * + * @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 updatePatchAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updatePatchWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Update the config server. + * + * @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 updatePatchAsync(String resourceGroupName, String serviceName) { + return updatePatchWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ConfigServerResourceInner>() { + @Override + public ConfigServerResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the config server. + * + * @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> updatePatchWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final ConfigServerProperties properties = null; + ConfigServerResourceInner configServerResource = new ConfigServerResourceInner(); + configServerResource.withProperties(null); + Observable> observable = service.updatePatch(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), configServerResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Update the config server. + * + * @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 properties Properties of the Config Server 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 ConfigServerResourceInner object if successful. + */ + public ConfigServerResourceInner updatePatch(String resourceGroupName, String serviceName, ConfigServerProperties properties) { + return updatePatchWithServiceResponseAsync(resourceGroupName, serviceName, properties).toBlocking().last().body(); + } + + /** + * Update the config server. + * + * @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 properties Properties of the Config Server 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 updatePatchAsync(String resourceGroupName, String serviceName, ConfigServerProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updatePatchWithServiceResponseAsync(resourceGroupName, serviceName, properties), serviceCallback); + } + + /** + * Update the config server. + * + * @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 properties Properties of the Config Server resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updatePatchAsync(String resourceGroupName, String serviceName, ConfigServerProperties properties) { + return updatePatchWithServiceResponseAsync(resourceGroupName, serviceName, properties).map(new Func1, ConfigServerResourceInner>() { + @Override + public ConfigServerResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the config server. + * + * @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 properties Properties of the Config Server resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updatePatchWithServiceResponseAsync(String resourceGroupName, String serviceName, ConfigServerProperties 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + ConfigServerResourceInner configServerResource = new ConfigServerResourceInner(); + configServerResource.withProperties(properties); + Observable> observable = service.updatePatch(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), configServerResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update the config server. + * + * @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 ConfigServerResourceInner object if successful. + */ + public ConfigServerResourceInner beginUpdatePatch(String resourceGroupName, String serviceName) { + return beginUpdatePatchWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); + } + + /** + * Update the config server. + * + * @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 beginUpdatePatchAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdatePatchWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Update the config server. + * + * @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 ConfigServerResourceInner object + */ + public Observable beginUpdatePatchAsync(String resourceGroupName, String serviceName) { + return beginUpdatePatchWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ConfigServerResourceInner>() { + @Override + public ConfigServerResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the config server. + * + * @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 ConfigServerResourceInner object + */ + public Observable> beginUpdatePatchWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final ConfigServerProperties properties = null; + ConfigServerResourceInner configServerResource = new ConfigServerResourceInner(); + configServerResource.withProperties(null); + return service.beginUpdatePatch(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), configServerResource, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdatePatchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update the config server. + * + * @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 properties Properties of the Config Server 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 ConfigServerResourceInner object if successful. + */ + public ConfigServerResourceInner beginUpdatePatch(String resourceGroupName, String serviceName, ConfigServerProperties properties) { + return beginUpdatePatchWithServiceResponseAsync(resourceGroupName, serviceName, properties).toBlocking().single().body(); + } + + /** + * Update the config server. + * + * @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 properties Properties of the Config Server 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 beginUpdatePatchAsync(String resourceGroupName, String serviceName, ConfigServerProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdatePatchWithServiceResponseAsync(resourceGroupName, serviceName, properties), serviceCallback); + } + + /** + * Update the config server. + * + * @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 properties Properties of the Config Server resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigServerResourceInner object + */ + public Observable beginUpdatePatchAsync(String resourceGroupName, String serviceName, ConfigServerProperties properties) { + return beginUpdatePatchWithServiceResponseAsync(resourceGroupName, serviceName, properties).map(new Func1, ConfigServerResourceInner>() { + @Override + public ConfigServerResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the config server. + * + * @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 properties Properties of the Config Server resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigServerResourceInner object + */ + public Observable> beginUpdatePatchWithServiceResponseAsync(String resourceGroupName, String serviceName, ConfigServerProperties 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + ConfigServerResourceInner configServerResource = new ConfigServerResourceInner(); + configServerResource.withProperties(properties); + return service.beginUpdatePatch(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), configServerResource, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdatePatchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdatePatchDelegate(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); + } + + /** + * Check if the config server settings are valid. + * + * @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 ConfigServerSettingsValidateResultInner object if successful. + */ + public ConfigServerSettingsValidateResultInner validate(String resourceGroupName, String serviceName) { + return validateWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().last().body(); + } + + /** + * Check if the config server settings are valid. + * + * @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 validateAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Check if the config server settings are valid. + * + * @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 validateAsync(String resourceGroupName, String serviceName) { + return validateWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ConfigServerSettingsValidateResultInner>() { + @Override + public ConfigServerSettingsValidateResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check if the config server settings are valid. + * + * @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> validateWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final ConfigServerGitProperty gitProperty = null; + ConfigServerSettings configServerSettings = new ConfigServerSettings(); + configServerSettings.withGitProperty(null); + Observable> observable = service.validate(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), configServerSettings, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + /** + * Check if the config server settings are valid. + * + * @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 gitProperty Property of git environment. + * @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 ConfigServerSettingsValidateResultInner object if successful. + */ + public ConfigServerSettingsValidateResultInner validate(String resourceGroupName, String serviceName, ConfigServerGitProperty gitProperty) { + return validateWithServiceResponseAsync(resourceGroupName, serviceName, gitProperty).toBlocking().last().body(); + } + + /** + * Check if the config server settings are valid. + * + * @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 gitProperty Property of git environment. + * @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, ConfigServerGitProperty gitProperty, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateWithServiceResponseAsync(resourceGroupName, serviceName, gitProperty), serviceCallback); + } + + /** + * Check if the config server settings are valid. + * + * @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 gitProperty Property of git environment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable validateAsync(String resourceGroupName, String serviceName, ConfigServerGitProperty gitProperty) { + return validateWithServiceResponseAsync(resourceGroupName, serviceName, gitProperty).map(new Func1, ConfigServerSettingsValidateResultInner>() { + @Override + public ConfigServerSettingsValidateResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check if the config server settings are valid. + * + * @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 gitProperty Property of git environment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> validateWithServiceResponseAsync(String resourceGroupName, String serviceName, ConfigServerGitProperty gitProperty) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(gitProperty); + ConfigServerSettings configServerSettings = new ConfigServerSettings(); + configServerSettings.withGitProperty(gitProperty); + Observable> observable = service.validate(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), configServerSettings, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Check if the config server settings are valid. + * + * @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 ConfigServerSettingsValidateResultInner object if successful. + */ + public ConfigServerSettingsValidateResultInner beginValidate(String resourceGroupName, String serviceName) { + return beginValidateWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); + } + + /** + * Check if the config server settings are valid. + * + * @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 beginValidateAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginValidateWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Check if the config server settings are valid. + * + * @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 ConfigServerSettingsValidateResultInner object + */ + public Observable beginValidateAsync(String resourceGroupName, String serviceName) { + return beginValidateWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ConfigServerSettingsValidateResultInner>() { + @Override + public ConfigServerSettingsValidateResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check if the config server settings are valid. + * + * @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 ConfigServerSettingsValidateResultInner object + */ + public Observable> beginValidateWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final ConfigServerGitProperty gitProperty = null; + ConfigServerSettings configServerSettings = new ConfigServerSettings(); + configServerSettings.withGitProperty(null); + return service.beginValidate(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), configServerSettings, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginValidateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Check if the config server settings are valid. + * + * @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 gitProperty Property of git environment. + * @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 ConfigServerSettingsValidateResultInner object if successful. + */ + public ConfigServerSettingsValidateResultInner beginValidate(String resourceGroupName, String serviceName, ConfigServerGitProperty gitProperty) { + return beginValidateWithServiceResponseAsync(resourceGroupName, serviceName, gitProperty).toBlocking().single().body(); + } + + /** + * Check if the config server settings are valid. + * + * @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 gitProperty Property of git environment. + * @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 beginValidateAsync(String resourceGroupName, String serviceName, ConfigServerGitProperty gitProperty, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginValidateWithServiceResponseAsync(resourceGroupName, serviceName, gitProperty), serviceCallback); + } + + /** + * Check if the config server settings are valid. + * + * @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 gitProperty Property of git environment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigServerSettingsValidateResultInner object + */ + public Observable beginValidateAsync(String resourceGroupName, String serviceName, ConfigServerGitProperty gitProperty) { + return beginValidateWithServiceResponseAsync(resourceGroupName, serviceName, gitProperty).map(new Func1, ConfigServerSettingsValidateResultInner>() { + @Override + public ConfigServerSettingsValidateResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check if the config server settings are valid. + * + * @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 gitProperty Property of git environment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigServerSettingsValidateResultInner object + */ + public Observable> beginValidateWithServiceResponseAsync(String resourceGroupName, String serviceName, ConfigServerGitProperty gitProperty) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(gitProperty); + ConfigServerSettings configServerSettings = new ConfigServerSettings(); + configServerSettings.withGitProperty(gitProperty); + return service.beginValidate(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), configServerSettings, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginValidateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginValidateDelegate(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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CustomDomainResourceImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CustomDomainResourceImpl.java new file mode 100644 index 000000000000..7df912f70bd5 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.CustomDomainResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_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.updateAsync(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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CustomDomainResourceInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CustomDomainResourceInner.java new file mode 100644 index 000000000000..c4e0bfcc6180 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CustomDomainValidateResultImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CustomDomainValidateResultImpl.java new file mode 100644 index 000000000000..469e91c98bc2 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CustomDomainValidateResultInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CustomDomainValidateResultInner.java new file mode 100644 index 000000000000..51bea8e5693b --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CustomDomainsImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CustomDomainsImpl.java new file mode 100644 index 000000000000..fd02e0fdcf60 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CustomDomainsImpl.java @@ -0,0 +1,85 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.CustomDomains; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.appplatform.v2020_11_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 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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CustomDomainsInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CustomDomainsInner.java new file mode 100644 index 000000000000..2fee4391a917 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/CustomDomainsInner.java @@ -0,0 +1,1388 @@ +/** + * 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.v2020_11_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.v2020_11_01_preview.CustomDomainProperties; +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.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.v2020_11_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.v2020_11_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.v2020_11_01_preview.CustomDomains beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}") + Observable> beginCreateOrUpdate(@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.v2020_11_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.v2020_11_01_preview.CustomDomains beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@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.v2020_11_01_preview.CustomDomains update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}") + Observable> update(@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.v2020_11_01_preview.CustomDomains beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}") + Observable> beginUpdate(@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.v2020_11_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.v2020_11_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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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().last().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 for the request + */ + 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 for the request + */ + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final CustomDomainProperties properties = null; + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(null); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * 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().last().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 for the request + */ + 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 for the request + */ + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(properties); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 beginCreateOrUpdate(String resourceGroupName, String serviceName, String appName, String domainName) { + return beginCreateOrUpdateWithServiceResponseAsync(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 beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(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 beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + return beginCreateOrUpdateWithServiceResponseAsync(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> beginCreateOrUpdateWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final CustomDomainProperties properties = null; + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(null); + return service.beginCreateOrUpdate(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 = beginCreateOrUpdateDelegate(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 beginCreateOrUpdate(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties) { + return beginCreateOrUpdateWithServiceResponseAsync(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 beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(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 beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties) { + return beginCreateOrUpdateWithServiceResponseAsync(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> beginCreateOrUpdateWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(properties); + return service.beginCreateOrUpdate(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 = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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()) + .register(202, 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().last().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 observable for the request + */ + 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 observable for the request + */ + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, serviceName, appName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 beginDelete(String resourceGroupName, String serviceName, String appName, String domainName) { + beginDeleteWithServiceResponseAsync(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 beginDeleteAsync(String resourceGroupName, String serviceName, String appName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(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 beginDeleteAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + return beginDeleteWithServiceResponseAsync(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> beginDeleteWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(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 = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(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()) + .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 update(String resourceGroupName, String serviceName, String appName, String domainName) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName).toBlocking().last().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 updateAsync(String resourceGroupName, String serviceName, String appName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(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 for the request + */ + public Observable updateAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + return updateWithServiceResponseAsync(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 for the request + */ + public Observable> updateWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final CustomDomainProperties properties = null; + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(null); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * 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 update(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, domainName, properties).toBlocking().last().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 updateAsync(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(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 for the request + */ + public Observable updateAsync(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties) { + return updateWithServiceResponseAsync(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 for the request + */ + public Observable> updateWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(properties); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 beginUpdate(String resourceGroupName, String serviceName, String appName, String domainName) { + return beginUpdateWithServiceResponseAsync(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 beginUpdateAsync(String resourceGroupName, String serviceName, String appName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(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 beginUpdateAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + return beginUpdateWithServiceResponseAsync(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> beginUpdateWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final CustomDomainProperties properties = null; + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(null); + return service.beginUpdate(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 = beginUpdateDelegate(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 beginUpdate(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties) { + return beginUpdateWithServiceResponseAsync(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 beginUpdateAsync(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(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 beginUpdateAsync(String resourceGroupName, String serviceName, String appName, String domainName, CustomDomainProperties properties) { + return beginUpdateWithServiceResponseAsync(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> beginUpdateWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(properties); + return service.beginUpdate(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 = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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); + } + + /** + * 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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); + } + + /** + * 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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/DeploymentResourceImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/DeploymentResourceImpl.java new file mode 100644 index 000000000000..edd17a95a70e --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/DeploymentResourceImpl.java @@ -0,0 +1,120 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.DeploymentResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.DeploymentResourceProperties; + +class DeploymentResourceImpl extends CreatableUpdatableImpl implements DeploymentResource, DeploymentResource.Definition, DeploymentResource.Update { + private final AppPlatformManager manager; + private String resourceGroupName; + private String serviceName; + private String appName; + private String deploymentName; + + DeploymentResourceImpl(String name, AppPlatformManager manager) { + super(name, new DeploymentResourceInner()); + this.manager = manager; + // Set resource name + this.deploymentName = name; + // + } + + DeploymentResourceImpl(DeploymentResourceInner inner, AppPlatformManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.deploymentName = 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.deploymentName = IdParsingUtils.getValueFromIdByName(inner.id(), "deployments"); + // + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DeploymentsInner client = this.manager().inner().deployments(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serviceName, this.appName, this.deploymentName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DeploymentsInner client = this.manager().inner().deployments(); + return client.updateAsync(this.resourceGroupName, this.serviceName, this.appName, this.deploymentName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DeploymentsInner client = this.manager().inner().deployments(); + return client.getAsync(this.resourceGroupName, this.serviceName, this.appName, this.deploymentName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DeploymentResourceProperties properties() { + return this.inner().properties(); + } + + @Override + public SkuInner sku() { + return this.inner().sku(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DeploymentResourceImpl withExistingApp(String resourceGroupName, String serviceName, String appName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.appName = appName; + return this; + } + + @Override + public DeploymentResourceImpl withProperties(DeploymentResourceProperties properties) { + this.inner().withProperties(properties); + return this; + } + + @Override + public DeploymentResourceImpl withSku(SkuInner sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/DeploymentResourceInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/DeploymentResourceInner.java new file mode 100644 index 000000000000..c152a8a079c2 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/DeploymentResourceInner.java @@ -0,0 +1,71 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.DeploymentResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * Deployment resource payload. + */ +public class DeploymentResourceInner extends ProxyResource { + /** + * Properties of the Deployment resource. + */ + @JsonProperty(value = "properties") + private DeploymentResourceProperties properties; + + /** + * Sku of the Deployment resource. + */ + @JsonProperty(value = "sku") + private SkuInner sku; + + /** + * Get properties of the Deployment resource. + * + * @return the properties value + */ + public DeploymentResourceProperties properties() { + return this.properties; + } + + /** + * Set properties of the Deployment resource. + * + * @param properties the properties value to set + * @return the DeploymentResourceInner object itself. + */ + public DeploymentResourceInner withProperties(DeploymentResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get sku of the Deployment resource. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Set sku of the Deployment resource. + * + * @param sku the sku value to set + * @return the DeploymentResourceInner object itself. + */ + public DeploymentResourceInner withSku(SkuInner sku) { + this.sku = sku; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/DeploymentsImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/DeploymentsImpl.java new file mode 100644 index 000000000000..204cc4c99807 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/DeploymentsImpl.java @@ -0,0 +1,134 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.Deployments; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.DeploymentResource; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.LogFileUrlResponse; + +class DeploymentsImpl extends WrapperImpl implements Deployments { + private final AppPlatformManager manager; + + DeploymentsImpl(AppPlatformManager manager) { + super(manager.inner().deployments()); + this.manager = manager; + } + + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public DeploymentResourceImpl define(String name) { + return wrapModel(name); + } + + private DeploymentResourceImpl wrapModel(DeploymentResourceInner inner) { + return new DeploymentResourceImpl(inner, manager()); + } + + private DeploymentResourceImpl wrapModel(String name) { + return new DeploymentResourceImpl(name, this.manager()); + } + + @Override + public Observable listForClusterAsync(final String resourceGroupName, final String serviceName) { + DeploymentsInner client = this.inner(); + return client.listForClusterAsync(resourceGroupName, serviceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DeploymentResource call(DeploymentResourceInner inner) { + return new DeploymentResourceImpl(inner, manager()); + } + }); + } + + @Override + public Completable startAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + DeploymentsInner client = this.inner(); + return client.startAsync(resourceGroupName, serviceName, appName, deploymentName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + DeploymentsInner client = this.inner(); + return client.stopAsync(resourceGroupName, serviceName, appName, deploymentName).toCompletable(); + } + + @Override + public Completable restartAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + DeploymentsInner client = this.inner(); + return client.restartAsync(resourceGroupName, serviceName, appName, deploymentName).toCompletable(); + } + + @Override + public Observable getLogFileUrlAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + DeploymentsInner client = this.inner(); + return client.getLogFileUrlAsync(resourceGroupName, serviceName, appName, deploymentName) + .map(new Func1() { + @Override + public LogFileUrlResponse call(LogFileUrlResponseInner inner) { + return new LogFileUrlResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String serviceName, final String appName) { + DeploymentsInner 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 DeploymentResource call(DeploymentResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + DeploymentsInner client = this.inner(); + return client.getAsync(resourceGroupName, serviceName, appName, deploymentName) + .flatMap(new Func1>() { + @Override + public Observable call(DeploymentResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DeploymentResource)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + DeploymentsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serviceName, appName, deploymentName).toCompletable(); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/DeploymentsInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/DeploymentsInner.java new file mode 100644 index 000000000000..db6b61f84d0d --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/DeploymentsInner.java @@ -0,0 +1,2208 @@ +/** + * 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.v2020_11_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.CollectionFormat; +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; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in Deployments. + */ +public class DeploymentsInner { + /** The Retrofit service to perform REST calls. */ + private DeploymentsService service; + /** The service client containing this operation class. */ + private AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of DeploymentsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DeploymentsInner(Retrofit retrofit, AppPlatformManagementClientImpl client) { + this.service = retrofit.create(DeploymentsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Deployments to be + * used by Retrofit to perform actually REST calls. + */ + interface DeploymentsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.Deployments get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("deploymentName") String deploymentName, @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.v2020_11_01_preview.Deployments createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("deploymentName") String deploymentName, @Query("api-version") String apiVersion, @Body DeploymentResourceInner deploymentResource, @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.v2020_11_01_preview.Deployments beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("deploymentName") String deploymentName, @Query("api-version") String apiVersion, @Body DeploymentResourceInner deploymentResource, @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.v2020_11_01_preview.Deployments delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("deploymentName") String deploymentName, @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.v2020_11_01_preview.Deployments beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("deploymentName") String deploymentName, @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.v2020_11_01_preview.Deployments update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("deploymentName") String deploymentName, @Query("api-version") String apiVersion, @Body DeploymentResourceInner deploymentResource, @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.v2020_11_01_preview.Deployments beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("deploymentName") String deploymentName, @Query("api-version") String apiVersion, @Body DeploymentResourceInner deploymentResource, @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.v2020_11_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("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.v2020_11_01_preview.Deployments listForCluster" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments") + Observable> listForCluster(@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.v2020_11_01_preview.Deployments start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("deploymentName") String deploymentName, @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.v2020_11_01_preview.Deployments beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("deploymentName") String deploymentName, @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.v2020_11_01_preview.Deployments stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("deploymentName") String deploymentName, @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.v2020_11_01_preview.Deployments beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop") + Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("deploymentName") String deploymentName, @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.v2020_11_01_preview.Deployments restart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart") + Observable> restart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("deploymentName") String deploymentName, @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.v2020_11_01_preview.Deployments beginRestart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart") + Observable> beginRestart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("deploymentName") String deploymentName, @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.v2020_11_01_preview.Deployments getLogFileUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl") + Observable> getLogFileUrl(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Path("deploymentName") String deploymentName, @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.v2020_11_01_preview.Deployments listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @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.v2020_11_01_preview.Deployments listForClusterNext" }) + @GET + Observable> listForClusterNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a Deployment and its properties. + * + * @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 deploymentName The name of the Deployment 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 DeploymentResourceInner object if successful. + */ + public DeploymentResourceInner get(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).toBlocking().single().body(); + } + + /** + * Get a Deployment and its properties. + * + * @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 deploymentName The name of the Deployment 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 deploymentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName), serviceCallback); + } + + /** + * Get a Deployment and its properties. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeploymentResourceInner object + */ + public Observable getAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).map(new Func1, DeploymentResourceInner>() { + @Override + public DeploymentResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Deployment and its properties. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeploymentResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, 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 a new Deployment or update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource 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 DeploymentResourceInner object if successful. + */ + public DeploymentResourceInner createOrUpdate(String resourceGroupName, String serviceName, String appName, String deploymentName, DeploymentResourceInner deploymentResource) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource).toBlocking().last().body(); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource 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, String deploymentName, DeploymentResourceInner deploymentResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource), serviceCallback); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, DeploymentResourceInner deploymentResource) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource).map(new Func1, DeploymentResourceInner>() { + @Override + public DeploymentResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, DeploymentResourceInner deploymentResource) { + 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 (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (deploymentResource == null) { + throw new IllegalArgumentException("Parameter deploymentResource is required and cannot be null."); + } + Validator.validate(deploymentResource); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), deploymentResource, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource 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 DeploymentResourceInner object if successful. + */ + public DeploymentResourceInner beginCreateOrUpdate(String resourceGroupName, String serviceName, String appName, String deploymentName, DeploymentResourceInner deploymentResource) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource).toBlocking().single().body(); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource 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 beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, DeploymentResourceInner deploymentResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource), serviceCallback); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeploymentResourceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, DeploymentResourceInner deploymentResource) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource).map(new Func1, DeploymentResourceInner>() { + @Override + public DeploymentResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeploymentResourceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, DeploymentResourceInner deploymentResource) { + 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 (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (deploymentResource == null) { + throw new IllegalArgumentException("Parameter deploymentResource is required and cannot be null."); + } + Validator.validate(deploymentResource); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), deploymentResource, 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); + } + } + }); + } + + 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Operation to delete a Deployment. + * + * @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 deploymentName The name of the Deployment 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 deploymentName) { + deleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).toBlocking().last().body(); + } + + /** + * Operation to delete a Deployment. + * + * @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 deploymentName The name of the Deployment 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 deploymentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName), serviceCallback); + } + + /** + * Operation to delete a Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return deleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to delete a Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Operation to delete a Deployment. + * + * @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 deploymentName The name of the Deployment 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 beginDelete(String resourceGroupName, String serviceName, String appName, String deploymentName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).toBlocking().single().body(); + } + + /** + * Operation to delete a Deployment. + * + * @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 deploymentName The name of the Deployment 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 beginDeleteAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName), serviceCallback); + } + + /** + * Operation to delete a Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to delete a Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(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()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Operation to update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource 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 DeploymentResourceInner object if successful. + */ + public DeploymentResourceInner update(String resourceGroupName, String serviceName, String appName, String deploymentName, DeploymentResourceInner deploymentResource) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource).toBlocking().last().body(); + } + + /** + * Operation to update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource 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, String deploymentName, DeploymentResourceInner deploymentResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource), serviceCallback); + } + + /** + * Operation to update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, DeploymentResourceInner deploymentResource) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource).map(new Func1, DeploymentResourceInner>() { + @Override + public DeploymentResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, DeploymentResourceInner deploymentResource) { + 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 (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (deploymentResource == null) { + throw new IllegalArgumentException("Parameter deploymentResource is required and cannot be null."); + } + Validator.validate(deploymentResource); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), deploymentResource, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Operation to update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource 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 DeploymentResourceInner object if successful. + */ + public DeploymentResourceInner beginUpdate(String resourceGroupName, String serviceName, String appName, String deploymentName, DeploymentResourceInner deploymentResource) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource).toBlocking().single().body(); + } + + /** + * Operation to update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource 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 beginUpdateAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, DeploymentResourceInner deploymentResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource), serviceCallback); + } + + /** + * Operation to update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeploymentResourceInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, DeploymentResourceInner deploymentResource) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource).map(new Func1, DeploymentResourceInner>() { + @Override + public DeploymentResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to update an exiting Deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeploymentResourceInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, DeploymentResourceInner deploymentResource) { + 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 (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (deploymentResource == null) { + throw new IllegalArgumentException("Parameter deploymentResource is required and cannot be null."); + } + Validator.validate(deploymentResource); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), deploymentResource, 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); + } + } + }); + } + + 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); + } + + /** + * Handles requests to list all resources in an App. + * + * @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<DeploymentResourceInner> 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(); + } + }; + } + + /** + * Handles requests to list all resources in an App. + * + * @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); + } + + /** + * Handles requests to list all resources in an App. + * + * @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<DeploymentResourceInner> 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(); + } + }); + } + + /** + * Handles requests to list all resources in an App. + * + * @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<DeploymentResourceInner> 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)); + } + }); + } + + /** + * Handles requests to list all resources in an App. + * + * @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 PagedList<DeploymentResourceInner> 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final List version = null; + String versionConverted = this.client.serializerAdapter().serializeList(version, CollectionFormat.MULTI); + 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) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Handles requests to list all resources in an App. + * + * @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 version Version of the deployments to be listed + * @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<DeploymentResourceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String serviceName, final String appName, final List version) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, serviceName, appName, version).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Handles requests to list all resources in an App. + * + * @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 version Version of the deployments to be listed + * @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 List version, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, serviceName, appName, version), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Handles requests to list all resources in an App. + * + * @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 version Version of the deployments to be listed + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeploymentResourceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String serviceName, final String appName, final List version) { + return listWithServiceResponseAsync(resourceGroupName, serviceName, appName, version) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Handles requests to list all resources in an App. + * + * @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 version Version of the deployments to be listed + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeploymentResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String serviceName, final String appName, final List version) { + return listSinglePageAsync(resourceGroupName, serviceName, appName, version) + .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)); + } + }); + } + + /** + * Handles requests to list all resources in an App. + * + 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. + ServiceResponse> * @param version Version of the deployments to be listed + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeploymentResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String serviceName, final String appName, final List version) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(version); + String versionConverted = this.client.serializerAdapter().serializeList(version, CollectionFormat.MULTI); + 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) { + 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 deployments for a certain 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 PagedList<DeploymentResourceInner> object if successful. + */ + public PagedList listForCluster(final String resourceGroupName, final String serviceName) { + ServiceResponse> response = listForClusterSinglePageAsync(resourceGroupName, serviceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List deployments for a certain 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> listForClusterAsync(final String resourceGroupName, final String serviceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForClusterSinglePageAsync(resourceGroupName, serviceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List deployments for a certain 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 PagedList<DeploymentResourceInner> object + */ + public Observable> listForClusterAsync(final String resourceGroupName, final String serviceName) { + return listForClusterWithServiceResponseAsync(resourceGroupName, serviceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List deployments for a certain 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 PagedList<DeploymentResourceInner> object + */ + public Observable>> listForClusterWithServiceResponseAsync(final String resourceGroupName, final String serviceName) { + return listForClusterSinglePageAsync(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(listForClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List deployments for a certain 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 PagedList<DeploymentResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForClusterSinglePageAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final List version = null; + String versionConverted = this.client.serializerAdapter().serializeList(version, CollectionFormat.MULTI); + return service.listForCluster(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) { + try { + ServiceResponse> result = listForClusterDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List deployments for a certain 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 version Version of the deployments to be listed + * @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<DeploymentResourceInner> object if successful. + */ + public PagedList listForCluster(final String resourceGroupName, final String serviceName, final List version) { + ServiceResponse> response = listForClusterSinglePageAsync(resourceGroupName, serviceName, version).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List deployments for a certain 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 version Version of the deployments to be listed + * @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> listForClusterAsync(final String resourceGroupName, final String serviceName, final List version, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForClusterSinglePageAsync(resourceGroupName, serviceName, version), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List deployments for a certain 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 version Version of the deployments to be listed + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeploymentResourceInner> object + */ + public Observable> listForClusterAsync(final String resourceGroupName, final String serviceName, final List version) { + return listForClusterWithServiceResponseAsync(resourceGroupName, serviceName, version) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List deployments for a certain 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 version Version of the deployments to be listed + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeploymentResourceInner> object + */ + public Observable>> listForClusterWithServiceResponseAsync(final String resourceGroupName, final String serviceName, final List version) { + return listForClusterSinglePageAsync(resourceGroupName, serviceName, version) + .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(listForClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List deployments for a certain service. + * + 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 version Version of the deployments to be listed + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeploymentResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForClusterSinglePageAsync(final String resourceGroupName, final String serviceName, final List version) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(version); + String versionConverted = this.client.serializerAdapter().serializeList(version, CollectionFormat.MULTI); + return service.listForCluster(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) { + try { + ServiceResponse> result = listForClusterDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listForClusterDelegate(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); + } + + /** + * Start the deployment. + * + * @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 deploymentName The name of the Deployment 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 start(String resourceGroupName, String serviceName, String appName, String deploymentName) { + startWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).toBlocking().last().body(); + } + + /** + * Start the deployment. + * + * @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 deploymentName The name of the Deployment 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 startAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName), serviceCallback); + } + + /** + * Start the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return startWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.AZURE_ASYNC_OPERATION), new TypeToken() { }.getType()); + } + + /** + * Start the deployment. + * + * @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 deploymentName The name of the Deployment 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 beginStart(String resourceGroupName, String serviceName, String appName, String deploymentName) { + beginStartWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).toBlocking().single().body(); + } + + /** + * Start the deployment. + * + * @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 deploymentName The name of the Deployment 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 beginStartAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName), serviceCallback); + } + + /** + * Start the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginStartWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(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); + } + + /** + * Stop the deployment. + * + * @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 deploymentName The name of the Deployment 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 stop(String resourceGroupName, String serviceName, String appName, String deploymentName) { + stopWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).toBlocking().last().body(); + } + + /** + * Stop the deployment. + * + * @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 deploymentName The name of the Deployment 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 stopAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName), serviceCallback); + } + + /** + * Stop the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return stopWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.AZURE_ASYNC_OPERATION), new TypeToken() { }.getType()); + } + + /** + * Stop the deployment. + * + * @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 deploymentName The name of the Deployment 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 beginStop(String resourceGroupName, String serviceName, String appName, String deploymentName) { + beginStopWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).toBlocking().single().body(); + } + + /** + * Stop the deployment. + * + * @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 deploymentName The name of the Deployment 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 beginStopAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName), serviceCallback); + } + + /** + * Stop the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginStopWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStop(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(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); + } + + /** + * Restart the deployment. + * + * @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 deploymentName The name of the Deployment 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 restart(String resourceGroupName, String serviceName, String appName, String deploymentName) { + restartWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).toBlocking().last().body(); + } + + /** + * Restart the deployment. + * + * @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 deploymentName The name of the Deployment 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 restartAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restartWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName), serviceCallback); + } + + /** + * Restart the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable restartAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return restartWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restart the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> restartWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.restart(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.AZURE_ASYNC_OPERATION), new TypeToken() { }.getType()); + } + + /** + * Restart the deployment. + * + * @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 deploymentName The name of the Deployment 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 beginRestart(String resourceGroupName, String serviceName, String appName, String deploymentName) { + beginRestartWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).toBlocking().single().body(); + } + + /** + * Restart the deployment. + * + * @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 deploymentName The name of the Deployment 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 beginRestartAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRestartWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName), serviceCallback); + } + + /** + * Restart the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRestartAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginRestartWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restart the deployment. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRestartWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginRestart(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRestartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRestartDelegate(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); + } + + /** + * Get deployment log file URL. + * + * @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 deploymentName The name of the Deployment 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 LogFileUrlResponseInner object if successful. + */ + public LogFileUrlResponseInner getLogFileUrl(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getLogFileUrlWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).toBlocking().single().body(); + } + + /** + * Get deployment log file URL. + * + * @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 deploymentName The name of the Deployment 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 getLogFileUrlAsync(String resourceGroupName, String serviceName, String appName, String deploymentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLogFileUrlWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName), serviceCallback); + } + + /** + * Get deployment log file URL. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogFileUrlResponseInner object + */ + public Observable getLogFileUrlAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getLogFileUrlWithServiceResponseAsync(resourceGroupName, serviceName, appName, deploymentName).map(new Func1, LogFileUrlResponseInner>() { + @Override + public LogFileUrlResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get deployment log file URL. + * + * @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 deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogFileUrlResponseInner object + */ + public Observable> getLogFileUrlWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getLogFileUrl(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLogFileUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLogFileUrlDelegate(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); + } + + /** + * Handles requests to list all resources in an App. + * + * @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<DeploymentResourceInner> 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(); + } + }; + } + + /** + * Handles requests to list all resources in an App. + * + * @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); + } + + /** + * Handles requests to list all resources in an App. + * + * @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<DeploymentResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Handles requests to list all resources in an App. + * + * @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<DeploymentResourceInner> 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)); + } + }); + } + + /** + * Handles requests to list all resources in an App. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeploymentResourceInner> 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); + } + + /** + * List deployments for a certain service. + * + * @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<DeploymentResourceInner> object if successful. + */ + public PagedList listForClusterNext(final String nextPageLink) { + ServiceResponse> response = listForClusterNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listForClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List deployments for a certain service. + * + * @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> listForClusterNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listForClusterNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listForClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List deployments for a certain service. + * + * @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<DeploymentResourceInner> object + */ + public Observable> listForClusterNextAsync(final String nextPageLink) { + return listForClusterNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List deployments for a certain service. + * + * @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<DeploymentResourceInner> object + */ + public Observable>> listForClusterNextWithServiceResponseAsync(final String nextPageLink) { + return listForClusterNextSinglePageAsync(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(listForClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List deployments for a certain service. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeploymentResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listForClusterNextSinglePageAsync(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.listForClusterNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listForClusterNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listForClusterNextDelegate(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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/IdParsingUtils.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..e0c14719a085 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * 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.v2020_11_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/LogFileUrlResponseImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/LogFileUrlResponseImpl.java new file mode 100644 index 000000000000..281c83811d6a --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/LogFileUrlResponseImpl.java @@ -0,0 +1,31 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.LogFileUrlResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LogFileUrlResponseImpl extends WrapperImpl implements LogFileUrlResponse { + private final AppPlatformManager manager; + LogFileUrlResponseImpl(LogFileUrlResponseInner inner, AppPlatformManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public String url() { + return this.inner().url(); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/LogFileUrlResponseInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/LogFileUrlResponseInner.java new file mode 100644 index 000000000000..adf63db91029 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/LogFileUrlResponseInner.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.v2020_11_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Log file URL payload. + */ +public class LogFileUrlResponseInner { + /** + * URL of the log file. + */ + @JsonProperty(value = "url", required = true) + private String url; + + /** + * Get uRL of the log file. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set uRL of the log file. + * + * @param url the url value to set + * @return the LogFileUrlResponseInner object itself. + */ + public LogFileUrlResponseInner withUrl(String url) { + this.url = url; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/MonitoringSettingResourceImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/MonitoringSettingResourceImpl.java new file mode 100644 index 000000000000..bffb9460c3d0 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/MonitoringSettingResourceImpl.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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.MonitoringSettingResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.MonitoringSettingProperties; + +class MonitoringSettingResourceImpl extends WrapperImpl implements MonitoringSettingResource { + private final AppPlatformManager manager; + MonitoringSettingResourceImpl(MonitoringSettingResourceInner inner, AppPlatformManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public MonitoringSettingProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/MonitoringSettingResourceInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/MonitoringSettingResourceInner.java new file mode 100644 index 000000000000..8e6a9e125506 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/MonitoringSettingResourceInner.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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.MonitoringSettingProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * Monitoring Setting resource. + */ +public class MonitoringSettingResourceInner extends ProxyResource { + /** + * Properties of the Monitoring Setting resource. + */ + @JsonProperty(value = "properties") + private MonitoringSettingProperties properties; + + /** + * Get properties of the Monitoring Setting resource. + * + * @return the properties value + */ + public MonitoringSettingProperties properties() { + return this.properties; + } + + /** + * Set properties of the Monitoring Setting resource. + * + * @param properties the properties value to set + * @return the MonitoringSettingResourceInner object itself. + */ + public MonitoringSettingResourceInner withProperties(MonitoringSettingProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/MonitoringSettingsImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/MonitoringSettingsImpl.java new file mode 100644 index 000000000000..ff3a4588c481 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/MonitoringSettingsImpl.java @@ -0,0 +1,66 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.MonitoringSettings; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.MonitoringSettingResource; + +class MonitoringSettingsImpl extends WrapperImpl implements MonitoringSettings { + private final AppPlatformManager manager; + + MonitoringSettingsImpl(AppPlatformManager manager) { + super(manager.inner().monitoringSettings()); + this.manager = manager; + } + + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String resourceGroupName, String serviceName) { + MonitoringSettingsInner client = this.inner(); + return client.getAsync(resourceGroupName, serviceName) + .map(new Func1() { + @Override + public MonitoringSettingResource call(MonitoringSettingResourceInner inner) { + return new MonitoringSettingResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable updatePutAsync(String resourceGroupName, String serviceName) { + MonitoringSettingsInner client = this.inner(); + return client.updatePutAsync(resourceGroupName, serviceName) + .map(new Func1() { + @Override + public MonitoringSettingResource call(MonitoringSettingResourceInner inner) { + return new MonitoringSettingResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable updatePatchAsync(String resourceGroupName, String serviceName) { + MonitoringSettingsInner client = this.inner(); + return client.updatePatchAsync(resourceGroupName, serviceName) + .map(new Func1() { + @Override + public MonitoringSettingResource call(MonitoringSettingResourceInner inner) { + return new MonitoringSettingResourceImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/MonitoringSettingsInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/MonitoringSettingsInner.java new file mode 100644 index 000000000000..7882cfcf41b5 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/MonitoringSettingsInner.java @@ -0,0 +1,813 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.MonitoringSettingProperties; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +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 MonitoringSettings. + */ +public class MonitoringSettingsInner { + /** The Retrofit service to perform REST calls. */ + private MonitoringSettingsService service; + /** The service client containing this operation class. */ + private AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of MonitoringSettingsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MonitoringSettingsInner(Retrofit retrofit, AppPlatformManagementClientImpl client) { + this.service = retrofit.create(MonitoringSettingsService.class); + this.client = client; + } + + /** + * The interface defining all the services for MonitoringSettings to be + * used by Retrofit to perform actually REST calls. + */ + interface MonitoringSettingsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.MonitoringSettings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default") + Observable> get(@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.v2020_11_01_preview.MonitoringSettings updatePut" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default") + Observable> updatePut(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body MonitoringSettingResourceInner monitoringSettingResource, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.MonitoringSettings beginUpdatePut" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default") + Observable> beginUpdatePut(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body MonitoringSettingResourceInner monitoringSettingResource, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.MonitoringSettings updatePatch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default") + Observable> updatePatch(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body MonitoringSettingResourceInner monitoringSettingResource, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.MonitoringSettings beginUpdatePatch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default") + Observable> beginUpdatePatch(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body MonitoringSettingResourceInner monitoringSettingResource, @Header("User-Agent") String userAgent); + + } + + /** + * Get the Monitoring Setting and its properties. + * + * @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 MonitoringSettingResourceInner object if successful. + */ + public MonitoringSettingResourceInner get(String resourceGroupName, String serviceName) { + return getWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); + } + + /** + * Get the Monitoring Setting and its properties. + * + * @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 getAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Get the Monitoring Setting and its properties. + * + * @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 MonitoringSettingResourceInner object + */ + public Observable getAsync(String resourceGroupName, String serviceName) { + return getWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, MonitoringSettingResourceInner>() { + @Override + public MonitoringSettingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the Monitoring Setting and its properties. + * + * @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 MonitoringSettingResourceInner object + */ + public Observable> getWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(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 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); + } + + /** + * Update the Monitoring Setting. + * + * @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 MonitoringSettingResourceInner object if successful. + */ + public MonitoringSettingResourceInner updatePut(String resourceGroupName, String serviceName) { + return updatePutWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().last().body(); + } + + /** + * Update the Monitoring Setting. + * + * @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 updatePutAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updatePutWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Update the Monitoring Setting. + * + * @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 updatePutAsync(String resourceGroupName, String serviceName) { + return updatePutWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, MonitoringSettingResourceInner>() { + @Override + public MonitoringSettingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the Monitoring Setting. + * + * @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> updatePutWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final MonitoringSettingProperties properties = null; + MonitoringSettingResourceInner monitoringSettingResource = new MonitoringSettingResourceInner(); + monitoringSettingResource.withProperties(null); + Observable> observable = service.updatePut(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), monitoringSettingResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting 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 MonitoringSettingResourceInner object if successful. + */ + public MonitoringSettingResourceInner updatePut(String resourceGroupName, String serviceName, MonitoringSettingProperties properties) { + return updatePutWithServiceResponseAsync(resourceGroupName, serviceName, properties).toBlocking().last().body(); + } + + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting 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 updatePutAsync(String resourceGroupName, String serviceName, MonitoringSettingProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updatePutWithServiceResponseAsync(resourceGroupName, serviceName, properties), serviceCallback); + } + + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updatePutAsync(String resourceGroupName, String serviceName, MonitoringSettingProperties properties) { + return updatePutWithServiceResponseAsync(resourceGroupName, serviceName, properties).map(new Func1, MonitoringSettingResourceInner>() { + @Override + public MonitoringSettingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updatePutWithServiceResponseAsync(String resourceGroupName, String serviceName, MonitoringSettingProperties 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + MonitoringSettingResourceInner monitoringSettingResource = new MonitoringSettingResourceInner(); + monitoringSettingResource.withProperties(properties); + Observable> observable = service.updatePut(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), monitoringSettingResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update the Monitoring Setting. + * + * @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 MonitoringSettingResourceInner object if successful. + */ + public MonitoringSettingResourceInner beginUpdatePut(String resourceGroupName, String serviceName) { + return beginUpdatePutWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); + } + + /** + * Update the Monitoring Setting. + * + * @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 beginUpdatePutAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdatePutWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Update the Monitoring Setting. + * + * @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 MonitoringSettingResourceInner object + */ + public Observable beginUpdatePutAsync(String resourceGroupName, String serviceName) { + return beginUpdatePutWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, MonitoringSettingResourceInner>() { + @Override + public MonitoringSettingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the Monitoring Setting. + * + * @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 MonitoringSettingResourceInner object + */ + public Observable> beginUpdatePutWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final MonitoringSettingProperties properties = null; + MonitoringSettingResourceInner monitoringSettingResource = new MonitoringSettingResourceInner(); + monitoringSettingResource.withProperties(null); + return service.beginUpdatePut(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), monitoringSettingResource, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdatePutDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting 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 MonitoringSettingResourceInner object if successful. + */ + public MonitoringSettingResourceInner beginUpdatePut(String resourceGroupName, String serviceName, MonitoringSettingProperties properties) { + return beginUpdatePutWithServiceResponseAsync(resourceGroupName, serviceName, properties).toBlocking().single().body(); + } + + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting 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 beginUpdatePutAsync(String resourceGroupName, String serviceName, MonitoringSettingProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdatePutWithServiceResponseAsync(resourceGroupName, serviceName, properties), serviceCallback); + } + + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MonitoringSettingResourceInner object + */ + public Observable beginUpdatePutAsync(String resourceGroupName, String serviceName, MonitoringSettingProperties properties) { + return beginUpdatePutWithServiceResponseAsync(resourceGroupName, serviceName, properties).map(new Func1, MonitoringSettingResourceInner>() { + @Override + public MonitoringSettingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MonitoringSettingResourceInner object + */ + public Observable> beginUpdatePutWithServiceResponseAsync(String resourceGroupName, String serviceName, MonitoringSettingProperties 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + MonitoringSettingResourceInner monitoringSettingResource = new MonitoringSettingResourceInner(); + monitoringSettingResource.withProperties(properties); + return service.beginUpdatePut(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), monitoringSettingResource, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdatePutDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdatePutDelegate(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); + } + + /** + * Update the Monitoring Setting. + * + * @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 MonitoringSettingResourceInner object if successful. + */ + public MonitoringSettingResourceInner updatePatch(String resourceGroupName, String serviceName) { + return updatePatchWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().last().body(); + } + + /** + * Update the Monitoring Setting. + * + * @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 updatePatchAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updatePatchWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Update the Monitoring Setting. + * + * @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 updatePatchAsync(String resourceGroupName, String serviceName) { + return updatePatchWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, MonitoringSettingResourceInner>() { + @Override + public MonitoringSettingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the Monitoring Setting. + * + * @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> updatePatchWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final MonitoringSettingProperties properties = null; + MonitoringSettingResourceInner monitoringSettingResource = new MonitoringSettingResourceInner(); + monitoringSettingResource.withProperties(null); + Observable> observable = service.updatePatch(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), monitoringSettingResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting 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 MonitoringSettingResourceInner object if successful. + */ + public MonitoringSettingResourceInner updatePatch(String resourceGroupName, String serviceName, MonitoringSettingProperties properties) { + return updatePatchWithServiceResponseAsync(resourceGroupName, serviceName, properties).toBlocking().last().body(); + } + + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting 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 updatePatchAsync(String resourceGroupName, String serviceName, MonitoringSettingProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updatePatchWithServiceResponseAsync(resourceGroupName, serviceName, properties), serviceCallback); + } + + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updatePatchAsync(String resourceGroupName, String serviceName, MonitoringSettingProperties properties) { + return updatePatchWithServiceResponseAsync(resourceGroupName, serviceName, properties).map(new Func1, MonitoringSettingResourceInner>() { + @Override + public MonitoringSettingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updatePatchWithServiceResponseAsync(String resourceGroupName, String serviceName, MonitoringSettingProperties 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + MonitoringSettingResourceInner monitoringSettingResource = new MonitoringSettingResourceInner(); + monitoringSettingResource.withProperties(properties); + Observable> observable = service.updatePatch(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), monitoringSettingResource, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update the Monitoring Setting. + * + * @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 MonitoringSettingResourceInner object if successful. + */ + public MonitoringSettingResourceInner beginUpdatePatch(String resourceGroupName, String serviceName) { + return beginUpdatePatchWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); + } + + /** + * Update the Monitoring Setting. + * + * @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 beginUpdatePatchAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdatePatchWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Update the Monitoring Setting. + * + * @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 MonitoringSettingResourceInner object + */ + public Observable beginUpdatePatchAsync(String resourceGroupName, String serviceName) { + return beginUpdatePatchWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, MonitoringSettingResourceInner>() { + @Override + public MonitoringSettingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the Monitoring Setting. + * + * @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 MonitoringSettingResourceInner object + */ + public Observable> beginUpdatePatchWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final MonitoringSettingProperties properties = null; + MonitoringSettingResourceInner monitoringSettingResource = new MonitoringSettingResourceInner(); + monitoringSettingResource.withProperties(null); + return service.beginUpdatePatch(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), monitoringSettingResource, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdatePatchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting 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 MonitoringSettingResourceInner object if successful. + */ + public MonitoringSettingResourceInner beginUpdatePatch(String resourceGroupName, String serviceName, MonitoringSettingProperties properties) { + return beginUpdatePatchWithServiceResponseAsync(resourceGroupName, serviceName, properties).toBlocking().single().body(); + } + + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting 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 beginUpdatePatchAsync(String resourceGroupName, String serviceName, MonitoringSettingProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdatePatchWithServiceResponseAsync(resourceGroupName, serviceName, properties), serviceCallback); + } + + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MonitoringSettingResourceInner object + */ + public Observable beginUpdatePatchAsync(String resourceGroupName, String serviceName, MonitoringSettingProperties properties) { + return beginUpdatePatchWithServiceResponseAsync(resourceGroupName, serviceName, properties).map(new Func1, MonitoringSettingResourceInner>() { + @Override + public MonitoringSettingResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the Monitoring Setting. + * + * @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 properties Properties of the Monitoring Setting resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MonitoringSettingResourceInner object + */ + public Observable> beginUpdatePatchWithServiceResponseAsync(String resourceGroupName, String serviceName, MonitoringSettingProperties 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + MonitoringSettingResourceInner monitoringSettingResource = new MonitoringSettingResourceInner(); + monitoringSettingResource.withProperties(properties); + return service.beginUpdatePatch(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), monitoringSettingResource, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdatePatchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdatePatchDelegate(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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/NameAvailabilityImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/NameAvailabilityImpl.java new file mode 100644 index 000000000000..9011140a9ec7 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/NameAvailabilityImpl.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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.NameAvailability; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class NameAvailabilityImpl extends WrapperImpl implements NameAvailability { + private final AppPlatformManager manager; + NameAvailabilityImpl(NameAvailabilityInner inner, AppPlatformManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/NameAvailabilityInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/NameAvailabilityInner.java new file mode 100644 index 000000000000..f1a391b3d32b --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/NameAvailabilityInner.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.v2020_11_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Name availability result payload. + */ +public class NameAvailabilityInner { + /** + * Indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * Reason why the name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Message why the name is not available. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get indicates whether the name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set indicates whether the name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get reason why the name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set reason why the name is not available. + * + * @param reason the reason value to set + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get message why the name is not available. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set message why the name is not available. + * + * @param message the message value to set + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/OperationDetailImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/OperationDetailImpl.java new file mode 100644 index 000000000000..a3338ffecf58 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/OperationDetailImpl.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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.OperationDetail; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.OperationDisplay; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.OperationProperties; + +class OperationDetailImpl extends WrapperImpl implements OperationDetail { + private final AppPlatformManager manager; + OperationDetailImpl(OperationDetailInner inner, AppPlatformManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public Boolean isDataAction() { + return this.inner().isDataAction(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public OperationProperties properties() { + return this.inner().properties(); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/OperationDetailInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/OperationDetailInner.java new file mode 100644 index 000000000000..d0d3ee050189 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/OperationDetailInner.java @@ -0,0 +1,149 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.OperationDisplay; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.OperationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation detail payload. + */ +public class OperationDetailInner { + /** + * Name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Indicates whether the operation is a data action. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /** + * Display of the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Properties of the operation. + */ + @JsonProperty(value = "properties") + private OperationProperties properties; + + /** + * Get name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the operation. + * + * @param name the name value to set + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get indicates whether the operation is a data action. + * + * @return the isDataAction value + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get display of the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set display of the operation. + * + * @param display the display value to set + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get origin of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin of the operation. + * + * @param origin the origin value to set + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get properties of the operation. + * + * @return the properties value + */ + public OperationProperties properties() { + return this.properties; + } + + /** + * Set properties of the operation. + * + * @param properties the properties value to set + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withProperties(OperationProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/OperationsImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/OperationsImpl.java new file mode 100644 index 000000000000..413d045e41a5 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.OperationDetail; + +class OperationsImpl extends WrapperImpl implements Operations { + private final AppPlatformManager manager; + + OperationsImpl(AppPlatformManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OperationDetail call(OperationDetailInner inner) { + return new OperationDetailImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/OperationsInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/OperationsInner.java new file mode 100644 index 000000000000..85a2c878f232 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * 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.v2020_11_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.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 Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, AppPlatformManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.Operations list" }) + @GET("providers/Microsoft.AppPlatform/operations") + Observable> list(@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.v2020_11_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available REST API operations of the 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 PagedList<OperationDetailInner> 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(); + } + }; + } + + /** + * Lists all of the available REST API operations of the 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> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDetailInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDetailInner> 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)); + } + }); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(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); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @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<OperationDetailInner> 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(); + } + }; + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @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); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @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<OperationDetailInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @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<OperationDetailInner> 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)); + } + }); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDetailInner> 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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/PageImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/PageImpl.java new file mode 100644 index 000000000000..273bf8cf4b23 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ResourceSkuImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ResourceSkuImpl.java new file mode 100644 index 000000000000..2228de037e21 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ResourceSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.SkuCapacity; +import java.util.List; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ResourceSkuLocationInfo; +import com.microsoft.azure.management.appplatform.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ResourceSkuInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ResourceSkuInner.java new file mode 100644 index 000000000000..d8dcc0710f14 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.SkuCapacity; +import java.util.List; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ResourceSkuLocationInfo; +import com.microsoft.azure.management.appplatform.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ResourceUploadDefinitionImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ResourceUploadDefinitionImpl.java new file mode 100644 index 000000000000..8cf9b5506c51 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ResourceUploadDefinitionImpl.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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ResourceUploadDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ResourceUploadDefinitionImpl extends WrapperImpl implements ResourceUploadDefinition { + private final AppPlatformManager manager; + ResourceUploadDefinitionImpl(ResourceUploadDefinitionInner inner, AppPlatformManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public String relativePath() { + return this.inner().relativePath(); + } + + @Override + public String uploadUrl() { + return this.inner().uploadUrl(); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ResourceUploadDefinitionInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ResourceUploadDefinitionInner.java new file mode 100644 index 000000000000..eb6a420ffa25 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ResourceUploadDefinitionInner.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.v2020_11_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Resource upload definition payload. + */ +public class ResourceUploadDefinitionInner { + /** + * Source relative path. + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /** + * Upload URL. + */ + @JsonProperty(value = "uploadUrl") + private String uploadUrl; + + /** + * Get source relative path. + * + * @return the relativePath value + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set source relative path. + * + * @param relativePath the relativePath value to set + * @return the ResourceUploadDefinitionInner object itself. + */ + public ResourceUploadDefinitionInner withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + + /** + * Get upload URL. + * + * @return the uploadUrl value + */ + public String uploadUrl() { + return this.uploadUrl; + } + + /** + * Set upload URL. + * + * @param uploadUrl the uploadUrl value to set + * @return the ResourceUploadDefinitionInner object itself. + */ + public ResourceUploadDefinitionInner withUploadUrl(String uploadUrl) { + this.uploadUrl = uploadUrl; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/RuntimeVersionsImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/RuntimeVersionsImpl.java new file mode 100644 index 000000000000..77fd699af380 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.RuntimeVersions; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/RuntimeVersionsInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/RuntimeVersionsInner.java new file mode 100644 index 000000000000..b09389c4898c --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/RuntimeVersionsInner.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.v2020_11_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.v2020_11_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() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + 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, IllegalArgumentException { + 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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ServiceResourceImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ServiceResourceImpl.java new file mode 100644 index 000000000000..199f89c87a33 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ServiceResourceImpl.java @@ -0,0 +1,63 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ServiceResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ClusterResourceProperties; +import java.util.Map; + +class ServiceResourceImpl extends WrapperImpl implements ServiceResource { + private final AppPlatformManager manager; + ServiceResourceImpl(ServiceResourceInner inner, AppPlatformManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ClusterResourceProperties properties() { + return this.inner().properties(); + } + + @Override + public SkuInner sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ServiceResourceInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ServiceResourceInner.java new file mode 100644 index 000000000000..697fcfbd08f4 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ServiceResourceInner.java @@ -0,0 +1,73 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ClusterResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Service resource. + */ +@SkipParentValidation +public class ServiceResourceInner extends Resource { + /** + * Properties of the Service resource. + */ + @JsonProperty(value = "properties") + private ClusterResourceProperties properties; + + /** + * Sku of the Service resource. + */ + @JsonProperty(value = "sku") + private SkuInner sku; + + /** + * Get properties of the Service resource. + * + * @return the properties value + */ + public ClusterResourceProperties properties() { + return this.properties; + } + + /** + * Set properties of the Service resource. + * + * @param properties the properties value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withProperties(ClusterResourceProperties properties) { + this.properties = 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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ServicesImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ServicesImpl.java new file mode 100644 index 000000000000..cf3baeeef027 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ServicesImpl.java @@ -0,0 +1,168 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.Services; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.ServiceResource; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.TestKeys; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.TestKeyType; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.NameAvailability; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.NameAvailabilityParameters; + +class ServicesImpl extends WrapperImpl implements Services { + private final AppPlatformManager manager; + + ServicesImpl(AppPlatformManager manager) { + super(manager.inner().services()); + this.manager = manager; + } + + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public Observable getByResourceGroupAsync(String resourceGroupName, String serviceName) { + ServicesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, serviceName) + .map(new Func1() { + @Override + public ServiceResource call(ServiceResourceInner inner) { + return new ServiceResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + ServicesInner client = this.inner(); + return client.createOrUpdateAsync(resourceGroupName, serviceName, resource) + .map(new Func1() { + @Override + public ServiceResource call(ServiceResourceInner inner) { + return new ServiceResourceImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serviceName) { + ServicesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serviceName).toCompletable(); + } + + @Override + public Observable updateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + ServicesInner client = this.inner(); + return client.updateAsync(resourceGroupName, serviceName, resource) + .map(new Func1() { + @Override + public ServiceResource call(ServiceResourceInner inner) { + return new ServiceResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateTestKeyAsync(String resourceGroupName, String serviceName, TestKeyType keyType) { + ServicesInner client = this.inner(); + return client.regenerateTestKeyAsync(resourceGroupName, serviceName, keyType) + .map(new Func1() { + @Override + public TestKeys call(TestKeysInner inner) { + return new TestKeysImpl(inner, manager()); + } + }); + } + + @Override + public Completable disableTestEndpointAsync(String resourceGroupName, String serviceName) { + ServicesInner client = this.inner(); + return client.disableTestEndpointAsync(resourceGroupName, serviceName).toCompletable(); + } + + @Override + public Observable enableTestEndpointAsync(String resourceGroupName, String serviceName) { + ServicesInner client = this.inner(); + return client.enableTestEndpointAsync(resourceGroupName, serviceName) + .map(new Func1() { + @Override + public TestKeys call(TestKeysInner inner) { + return new TestKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + ServicesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServiceResource call(ServiceResourceInner inner) { + return new ServiceResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByResourceGroupAsync(final String resourceGroupName) { + ServicesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServiceResource call(ServiceResourceInner inner) { + return new ServiceResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listTestKeysAsync(String resourceGroupName, String serviceName) { + ServicesInner client = this.inner(); + return client.listTestKeysAsync(resourceGroupName, serviceName) + .map(new Func1() { + @Override + public TestKeys call(TestKeysInner inner) { + return new TestKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String location, NameAvailabilityParameters availabilityParameters) { + ServicesInner client = this.inner(); + return client.checkNameAvailabilityAsync(location, availabilityParameters) + .map(new Func1() { + @Override + public NameAvailability call(NameAvailabilityInner inner) { + return new NameAvailabilityImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ServicesInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ServicesInner.java new file mode 100644 index 000000000000..58a00f69e92b --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/ServicesInner.java @@ -0,0 +1,1606 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +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.v2020_11_01_preview.NameAvailabilityParameters; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.RegenerateTestKeyRequestPayload; +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.TestKeyType; +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 Services. + */ +public class ServicesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ServicesService service; + /** The service client containing this operation class. */ + private AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of ServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServicesInner(Retrofit retrofit, AppPlatformManagementClientImpl client) { + this.service = retrofit.create(ServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Services to be + * used by Retrofit to perform actually REST calls. + */ + interface ServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.Services getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}") + Observable> getByResourceGroup(@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.v2020_11_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, @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.v2020_11_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, @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.v2020_11_01_preview.Services delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", method = "DELETE", hasBody = true) + Observable> delete(@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.v2020_11_01_preview.Services beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@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.v2020_11_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, @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.v2020_11_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, @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.v2020_11_01_preview.Services listTestKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys") + Observable> listTestKeys(@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.v2020_11_01_preview.Services regenerateTestKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey") + Observable> regenerateTestKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegenerateTestKeyRequestPayload regenerateTestKeyRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2020_11_01_preview.Services disableTestEndpoint" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint") + Observable> disableTestEndpoint(@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.v2020_11_01_preview.Services enableTestEndpoint" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint") + Observable> enableTestEndpoint(@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.v2020_11_01_preview.Services checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability") + 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.v2020_11_01_preview.Services list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring") + 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.v2020_11_01_preview.Services listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @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.v2020_11_01_preview.Services listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @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.v2020_11_01_preview.Services listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a Service and its properties. + * + * @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 getByResourceGroup(String resourceGroupName, String serviceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); + } + + /** + * Get a Service and its properties. + * + * @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 getByResourceGroupAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Get a Service and its properties. + * + * @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 getByResourceGroupAsync(String resourceGroupName, String serviceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ServiceResourceInner>() { + @Override + public ServiceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Service and its properties. + * + * @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> getByResourceGroupWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(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 clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(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 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 resource 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 ServiceResourceInner object if successful. + */ + public ServiceResourceInner createOrUpdate(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, resource).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 resource 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, ServiceResourceInner resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, resource), 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. + * @param resource Parameters for the create or update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, resource).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. + * @param resource Parameters for the create or update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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, 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. + * @param resource 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 ServiceResourceInner object if successful. + */ + public ServiceResourceInner beginCreateOrUpdate(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, resource).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 resource 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 beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, resource), 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. + * @param resource Parameters for the create or update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, resource).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. + * @param resource Parameters for the create or update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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, this.client.apiVersion(), resource, 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); + } + } + }); + } + + 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Operation to delete a 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 + */ + public void delete(String resourceGroupName, String serviceName) { + deleteWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().last().body(); + } + + /** + * Operation to delete a 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 deleteAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Operation to delete a 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 deleteAsync(String resourceGroupName, String serviceName) { + return deleteWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to delete a 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> deleteWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Operation to delete a 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 + */ + public void beginDelete(String resourceGroupName, String serviceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); + } + + /** + * Operation to delete a 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 beginDeleteAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Operation to delete a 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 {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serviceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to delete a 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 {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(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 clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .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. + * @param resource 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 ServiceResourceInner object if successful. + */ + public ServiceResourceInner update(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, resource).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 resource 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, ServiceResourceInner resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName, resource), 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. + * @param resource Parameters for the update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, resource).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. + * @param resource Parameters for the update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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, 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. + * @param resource 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 ServiceResourceInner object if successful. + */ + public ServiceResourceInner beginUpdate(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, resource).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 resource 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 beginUpdateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, resource), 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. + * @param resource Parameters for the update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, resource).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. + * @param resource Parameters for the update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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, this.client.apiVersion(), resource, 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); + } + } + }); + } + + 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); + } + + /** + * List test keys for a 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 TestKeysInner object if successful. + */ + public TestKeysInner listTestKeys(String resourceGroupName, String serviceName) { + return listTestKeysWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); + } + + /** + * List test keys for a 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 listTestKeysAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listTestKeysWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * List test keys for a 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 TestKeysInner object + */ + public Observable listTestKeysAsync(String resourceGroupName, String serviceName) { + return listTestKeysWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, TestKeysInner>() { + @Override + public TestKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List test keys for a 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 TestKeysInner object + */ + public Observable> listTestKeysWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listTestKeys(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 clientResponse = listTestKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listTestKeysDelegate(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); + } + + /** + * Regenerate a test key for a 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 keyType Type of the test key. Possible values include: 'Primary', 'Secondary' + * @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 TestKeysInner object if successful. + */ + public TestKeysInner regenerateTestKey(String resourceGroupName, String serviceName, TestKeyType keyType) { + return regenerateTestKeyWithServiceResponseAsync(resourceGroupName, serviceName, keyType).toBlocking().single().body(); + } + + /** + * Regenerate a test key for a 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 keyType Type of the test key. Possible values include: 'Primary', 'Secondary' + * @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 regenerateTestKeyAsync(String resourceGroupName, String serviceName, TestKeyType keyType, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateTestKeyWithServiceResponseAsync(resourceGroupName, serviceName, keyType), serviceCallback); + } + + /** + * Regenerate a test key for a 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 keyType Type of the test key. Possible values include: 'Primary', 'Secondary' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TestKeysInner object + */ + public Observable regenerateTestKeyAsync(String resourceGroupName, String serviceName, TestKeyType keyType) { + return regenerateTestKeyWithServiceResponseAsync(resourceGroupName, serviceName, keyType).map(new Func1, TestKeysInner>() { + @Override + public TestKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerate a test key for a 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 keyType Type of the test key. Possible values include: 'Primary', 'Secondary' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TestKeysInner object + */ + public Observable> regenerateTestKeyWithServiceResponseAsync(String resourceGroupName, String serviceName, TestKeyType keyType) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (keyType == null) { + throw new IllegalArgumentException("Parameter keyType is required and cannot be null."); + } + RegenerateTestKeyRequestPayload regenerateTestKeyRequest = new RegenerateTestKeyRequestPayload(); + regenerateTestKeyRequest.withKeyType(keyType); + return service.regenerateTestKey(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), regenerateTestKeyRequest, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateTestKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateTestKeyDelegate(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); + } + + /** + * Disable test endpoint functionality for a 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 + */ + public void disableTestEndpoint(String resourceGroupName, String serviceName) { + disableTestEndpointWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); + } + + /** + * Disable test endpoint functionality for a 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 disableTestEndpointAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableTestEndpointWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Disable test endpoint functionality for a 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 {@link ServiceResponse} object if successful. + */ + public Observable disableTestEndpointAsync(String resourceGroupName, String serviceName) { + return disableTestEndpointWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disable test endpoint functionality for a 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 {@link ServiceResponse} object if successful. + */ + public Observable> disableTestEndpointWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.disableTestEndpoint(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 clientResponse = disableTestEndpointDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse disableTestEndpointDelegate(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); + } + + /** + * Enable test endpoint functionality for a 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 TestKeysInner object if successful. + */ + public TestKeysInner enableTestEndpoint(String resourceGroupName, String serviceName) { + return enableTestEndpointWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); + } + + /** + * Enable test endpoint functionality for a 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 enableTestEndpointAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableTestEndpointWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Enable test endpoint functionality for a 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 TestKeysInner object + */ + public Observable enableTestEndpointAsync(String resourceGroupName, String serviceName) { + return enableTestEndpointWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, TestKeysInner>() { + @Override + public TestKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enable test endpoint functionality for a 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 TestKeysInner object + */ + public Observable> enableTestEndpointWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.enableTestEndpoint(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 clientResponse = enableTestEndpointDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enableTestEndpointDelegate(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); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region + * @param availabilityParameters Parameters supplied to the 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 NameAvailabilityInner object if successful. + */ + public NameAvailabilityInner checkNameAvailability(String location, NameAvailabilityParameters availabilityParameters) { + return checkNameAvailabilityWithServiceResponseAsync(location, availabilityParameters).toBlocking().single().body(); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region + * @param availabilityParameters Parameters supplied to the 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 checkNameAvailabilityAsync(String location, NameAvailabilityParameters availabilityParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(location, availabilityParameters), serviceCallback); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region + * @param availabilityParameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityInner object + */ + public Observable checkNameAvailabilityAsync(String location, NameAvailabilityParameters availabilityParameters) { + return checkNameAvailabilityWithServiceResponseAsync(location, availabilityParameters).map(new Func1, NameAvailabilityInner>() { + @Override + public NameAvailabilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region + * @param availabilityParameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, NameAvailabilityParameters availabilityParameters) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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(this.client.subscriptionId(), location, this.client.apiVersion(), availabilityParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(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); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @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<ServiceResourceInner> 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(); + } + }; + } + + /** + * Handles requests to list all resources in a subscription. + * + * @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); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceResourceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceResourceInner> 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)); + } + }); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceResourceInner> 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @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. + * @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<ServiceResourceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Handles requests to list all resources in a resource group. + * + * @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 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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceResourceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceResourceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Handles requests to list all resources in a resource group. + * + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(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); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @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<ServiceResourceInner> 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(); + } + }; + } + + /** + * Handles requests to list all resources in a subscription. + * + * @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); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @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<ServiceResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @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<ServiceResourceInner> 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)); + } + }); + } + + /** + * Handles requests to list all resources in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceResourceInner> 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); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @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<ServiceResourceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Handles requests to list all resources in a resource group. + * + * @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> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @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<ServiceResourceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @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<ServiceResourceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Handles requests to list all resources in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/SkuInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/SkuInner.java new file mode 100644 index 000000000000..a4be6e859cc6 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/SkusImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/SkusImpl.java new file mode 100644 index 000000000000..e1a6364d47d7 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_11_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.v2020_11_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-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/SkusInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/SkusInner.java new file mode 100644 index 000000000000..f2c7fc0ce3ed --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/SkusInner.java @@ -0,0 +1,287 @@ +/** + * 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.v2020_11_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.v2020_11_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.v2020_11_01_preview.Skus listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available skus of the 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 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(); + } + }; + } + + /** + * Lists all of the available skus of the 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> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @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(); + } + }); + } + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @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)); + } + }); + } + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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); + } + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @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(); + } + }; + } + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @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); + } + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @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(); + } + }); + } + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @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)); + } + }); + } + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + 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); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/TestKeysImpl.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/TestKeysImpl.java new file mode 100644 index 000000000000..5fe09fb499b8 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/TestKeysImpl.java @@ -0,0 +1,51 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.microsoft.azure.management.appplatform.v2020_11_01_preview.TestKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class TestKeysImpl extends WrapperImpl implements TestKeys { + private final AppPlatformManager manager; + TestKeysImpl(TestKeysInner inner, AppPlatformManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppPlatformManager manager() { + return this.manager; + } + + @Override + public Boolean enabled() { + return this.inner().enabled(); + } + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public String primaryTestEndpoint() { + return this.inner().primaryTestEndpoint(); + } + + @Override + public String secondaryKey() { + return this.inner().secondaryKey(); + } + + @Override + public String secondaryTestEndpoint() { + return this.inner().secondaryTestEndpoint(); + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/TestKeysInner.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/TestKeysInner.java new file mode 100644 index 000000000000..be187ff25033 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/TestKeysInner.java @@ -0,0 +1,147 @@ +/** + * 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.v2020_11_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Test keys payload. + */ +public class TestKeysInner { + /** + * Primary key. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * Secondary key. + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /** + * Primary test endpoint. + */ + @JsonProperty(value = "primaryTestEndpoint") + private String primaryTestEndpoint; + + /** + * Secondary test endpoint. + */ + @JsonProperty(value = "secondaryTestEndpoint") + private String secondaryTestEndpoint; + + /** + * Indicates whether the test endpoint feature enabled or not. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get primary key. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set primary key. + * + * @param primaryKey the primaryKey value to set + * @return the TestKeysInner object itself. + */ + public TestKeysInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get secondary key. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set secondary key. + * + * @param secondaryKey the secondaryKey value to set + * @return the TestKeysInner object itself. + */ + public TestKeysInner withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get primary test endpoint. + * + * @return the primaryTestEndpoint value + */ + public String primaryTestEndpoint() { + return this.primaryTestEndpoint; + } + + /** + * Set primary test endpoint. + * + * @param primaryTestEndpoint the primaryTestEndpoint value to set + * @return the TestKeysInner object itself. + */ + public TestKeysInner withPrimaryTestEndpoint(String primaryTestEndpoint) { + this.primaryTestEndpoint = primaryTestEndpoint; + return this; + } + + /** + * Get secondary test endpoint. + * + * @return the secondaryTestEndpoint value + */ + public String secondaryTestEndpoint() { + return this.secondaryTestEndpoint; + } + + /** + * Set secondary test endpoint. + * + * @param secondaryTestEndpoint the secondaryTestEndpoint value to set + * @return the TestKeysInner object itself. + */ + public TestKeysInner withSecondaryTestEndpoint(String secondaryTestEndpoint) { + this.secondaryTestEndpoint = secondaryTestEndpoint; + return this; + } + + /** + * Get indicates whether the test endpoint feature enabled or not. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set indicates whether the test endpoint feature enabled or not. + * + * @param enabled the enabled value to set + * @return the TestKeysInner object itself. + */ + public TestKeysInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/package-info.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/package-info.java new file mode 100644 index 000000000000..24d42a6084e8 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the implementation classes for AppPlatformManagementClient. + * REST API for Azure Spring Cloud. + */ +package com.microsoft.azure.management.appplatform.v2020_11_01_preview.implementation; diff --git a/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/package-info.java b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/package-info.java new file mode 100644 index 000000000000..10848028e9bd --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_11_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2020_11_01_preview/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the classes for AppPlatformManagementClient. + * REST API for Azure Spring Cloud. + */ +package com.microsoft.azure.management.appplatform.v2020_11_01_preview; diff --git a/sdk/appplatform/pom.mgmt.xml b/sdk/appplatform/pom.mgmt.xml index 1fcf82b493e4..537a03562191 100644 --- a/sdk/appplatform/pom.mgmt.xml +++ b/sdk/appplatform/pom.mgmt.xml @@ -11,5 +11,6 @@ mgmt-v2019_05_01_preview mgmt-v2020_07_01 + mgmt-v2020_11_01_preview