diff --git a/sdk/appplatform/mgmt-v2020_07_01/pom.xml b/sdk/appplatform/mgmt-v2020_07_01/pom.xml index 0a2942c67daf..758cade28248 100644 --- a/sdk/appplatform/mgmt-v2020_07_01/pom.xml +++ b/sdk/appplatform/mgmt-v2020_07_01/pom.xml @@ -11,8 +11,8 @@ com.microsoft.azure azure-arm-parent - 1.3.2 - ../../parents/azure-arm-parent/pom.xml + 1.1.0 + ../../../pom.management.xml azure-mgmt-appplatform 1.0.0-beta diff --git a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/AvailableRuntimeVersions.java b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/AvailableRuntimeVersions.java new file mode 100644 index 000000000000..9d833d89e2b2 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/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_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appplatform.v2020_07_01.implementation.AppPlatformManager; +import com.microsoft.azure.management.appplatform.v2020_07_01.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_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/DeploymentSettings.java b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/DeploymentSettings.java index 9334dd1f0b9c..14059e46e4e8 100644 --- a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/DeploymentSettings.java +++ b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/DeploymentSettings.java @@ -35,6 +35,12 @@ public class DeploymentSettings { @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. */ @@ -42,7 +48,8 @@ public class DeploymentSettings { private Map environmentVariables; /** - * Runtime version. Possible values include: 'Java_8', 'Java_11'. + * Runtime version. Possible values include: 'Java_8', 'Java_11', + * 'NetCore_31'. */ @JsonProperty(value = "runtimeVersion") private RuntimeVersion runtimeVersion; @@ -107,6 +114,26 @@ public DeploymentSettings withJvmOptions(String 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. * @@ -128,7 +155,7 @@ public DeploymentSettings withEnvironmentVariables(Map environme } /** - * Get runtime version. Possible values include: 'Java_8', 'Java_11'. + * Get runtime version. Possible values include: 'Java_8', 'Java_11', 'NetCore_31'. * * @return the runtimeVersion value */ @@ -137,7 +164,7 @@ public RuntimeVersion runtimeVersion() { } /** - * Set runtime version. Possible values include: 'Java_8', 'Java_11'. + * Set runtime version. Possible values include: 'Java_8', 'Java_11', 'NetCore_31'. * * @param runtimeVersion the runtimeVersion value to set * @return the DeploymentSettings object itself. diff --git a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/RuntimeVersion.java b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/RuntimeVersion.java index 2e20f3a04156..bbe94fd09daa 100644 --- a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/RuntimeVersion.java +++ b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/RuntimeVersion.java @@ -22,6 +22,9 @@ public final class RuntimeVersion extends ExpandableStringEnum { /** Static value Java_11 for RuntimeVersion. */ public static final RuntimeVersion JAVA_11 = fromString("Java_11"); + /** Static value NetCore_31 for RuntimeVersion. */ + public static final RuntimeVersion NET_CORE_31 = fromString("NetCore_31"); + /** * Creates or finds a RuntimeVersion from its string representation. * @param name a name to look for diff --git a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/RuntimeVersions.java b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/RuntimeVersions.java new file mode 100644 index 000000000000..f640b80fdcb9 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/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_07_01; + +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_07_01.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_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/SupportedRuntimePlatform.java b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/SupportedRuntimePlatform.java new file mode 100644 index 000000000000..4d85ab1d83fb --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/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_07_01; + +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_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/SupportedRuntimeVersion.java b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/SupportedRuntimeVersion.java new file mode 100644 index 000000000000..b970011c682c --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/SupportedRuntimeVersion.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2020_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SupportedRuntimeVersion. + */ +public final class SupportedRuntimeVersion extends ExpandableStringEnum { + /** Static value Java_8 for SupportedRuntimeVersion. */ + public static final SupportedRuntimeVersion JAVA_8 = fromString("Java_8"); + + /** Static value Java_11 for SupportedRuntimeVersion. */ + public static final SupportedRuntimeVersion JAVA_11 = fromString("Java_11"); + + /** Static value NetCore_31 for SupportedRuntimeVersion. */ + public static final SupportedRuntimeVersion NET_CORE_31 = fromString("NetCore_31"); + + /** + * Creates or finds a SupportedRuntimeVersion from its string representation. + * @param name a name to look for + * @return the corresponding SupportedRuntimeVersion + */ + @JsonCreator + public static SupportedRuntimeVersion fromString(String name) { + return fromString(name, SupportedRuntimeVersion.class); + } + + /** + * @return known SupportedRuntimeVersion values + */ + public static Collection values() { + return values(SupportedRuntimeVersion.class); + } +} diff --git a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/SupportedRuntimeVersion1.java b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/SupportedRuntimeVersion1.java new file mode 100644 index 000000000000..81dd10034f95 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/SupportedRuntimeVersion1.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Supported deployment runtime version descriptor. + */ +public class SupportedRuntimeVersion1 { + /** + * The raw value which could be passed to deployment CRUD operations. + * Possible values include: 'Java_8', 'Java_11', 'NetCore_31'. + */ + @JsonProperty(value = "value") + private SupportedRuntimeVersion value; + + /** + * The platform of this runtime version (possible values: "Java" or + * ".NET"). Possible values include: 'Java', '.NET Core'. + */ + @JsonProperty(value = "platform") + private SupportedRuntimePlatform platform; + + /** + * The detailed version (major.minor) of the platform. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the raw value which could be passed to deployment CRUD operations. Possible values include: 'Java_8', 'Java_11', 'NetCore_31'. + * + * @return the value value + */ + public SupportedRuntimeVersion value() { + return this.value; + } + + /** + * Set the raw value which could be passed to deployment CRUD operations. Possible values include: 'Java_8', 'Java_11', 'NetCore_31'. + * + * @param value the value value to set + * @return the SupportedRuntimeVersion1 object itself. + */ + public SupportedRuntimeVersion1 withValue(SupportedRuntimeVersion value) { + this.value = value; + return this; + } + + /** + * Get the platform of this runtime version (possible values: "Java" or ".NET"). Possible values include: 'Java', '.NET Core'. + * + * @return the platform value + */ + public SupportedRuntimePlatform platform() { + return this.platform; + } + + /** + * Set the platform of this runtime version (possible values: "Java" or ".NET"). Possible values include: 'Java', '.NET Core'. + * + * @param platform the platform value to set + * @return the SupportedRuntimeVersion1 object itself. + */ + public SupportedRuntimeVersion1 withPlatform(SupportedRuntimePlatform platform) { + this.platform = platform; + return this; + } + + /** + * Get the detailed version (major.minor) of the platform. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the detailed version (major.minor) of the platform. + * + * @param version the version value to set + * @return the SupportedRuntimeVersion1 object itself. + */ + public SupportedRuntimeVersion1 withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/UserSourceInfo.java b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/UserSourceInfo.java index bc192f235545..58254a2f6f28 100644 --- a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/UserSourceInfo.java +++ b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/UserSourceInfo.java @@ -15,7 +15,8 @@ */ public class UserSourceInfo { /** - * Type of the source uploaded. Possible values include: 'Jar', 'Source'. + * Type of the source uploaded. Possible values include: 'Jar', + * 'NetCoreZip', 'Source'. */ @JsonProperty(value = "type") private UserSourceType type; @@ -41,7 +42,7 @@ public class UserSourceInfo { private String artifactSelector; /** - * Get type of the source uploaded. Possible values include: 'Jar', 'Source'. + * Get type of the source uploaded. Possible values include: 'Jar', 'NetCoreZip', 'Source'. * * @return the type value */ @@ -50,7 +51,7 @@ public UserSourceType type() { } /** - * Set type of the source uploaded. Possible values include: 'Jar', 'Source'. + * Set type of the source uploaded. Possible values include: 'Jar', 'NetCoreZip', 'Source'. * * @param type the type value to set * @return the UserSourceInfo object itself. diff --git a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/UserSourceType.java b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/UserSourceType.java index cb4dafb45cd3..1e885b50af2c 100644 --- a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/UserSourceType.java +++ b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/UserSourceType.java @@ -19,6 +19,9 @@ public final class UserSourceType extends ExpandableStringEnum { /** Static value Jar for UserSourceType. */ public static final UserSourceType JAR = fromString("Jar"); + /** Static value NetCoreZip for UserSourceType. */ + public static final UserSourceType NET_CORE_ZIP = fromString("NetCoreZip"); + /** Static value Source for UserSourceType. */ public static final UserSourceType SOURCE = fromString("Source"); diff --git a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/AppPlatformManagementClientImpl.java b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/AppPlatformManagementClientImpl.java index fbd1e5aba0f9..6b809856af7f 100644 --- a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/AppPlatformManagementClientImpl.java +++ b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/AppPlatformManagementClientImpl.java @@ -251,6 +251,19 @@ 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. */ @@ -308,6 +321,7 @@ protected void initialize() { this.customDomains = new CustomDomainsInner(restClient().retrofit(), this); this.deployments = new DeploymentsInner(restClient().retrofit(), this); this.operations = new OperationsInner(restClient().retrofit(), this); + this.runtimeVersions = new RuntimeVersionsInner(restClient().retrofit(), this); this.skus = new SkusInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/AppPlatformManager.java b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/AppPlatformManager.java index 10397effbfdf..bd7c1019fea0 100644 --- a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/AppPlatformManager.java +++ b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/AppPlatformManager.java @@ -25,6 +25,7 @@ import com.microsoft.azure.management.appplatform.v2020_07_01.CustomDomains; import com.microsoft.azure.management.appplatform.v2020_07_01.Deployments; import com.microsoft.azure.management.appplatform.v2020_07_01.Operations; +import com.microsoft.azure.management.appplatform.v2020_07_01.RuntimeVersions; import com.microsoft.azure.management.appplatform.v2020_07_01.Skus; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -42,6 +43,7 @@ public final class AppPlatformManager extends ManagerCore 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_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/AvailableRuntimeVersionsInner.java b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/AvailableRuntimeVersionsInner.java new file mode 100644 index 000000000000..e144c2fc59e4 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/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_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.appplatform.v2020_07_01.SupportedRuntimeVersion1; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The AvailableRuntimeVersionsInner model. + */ +public class AvailableRuntimeVersionsInner { + /** + * A list of all supported runtime versions. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get a list of all supported runtime versions. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/RuntimeVersionsImpl.java b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/RuntimeVersionsImpl.java new file mode 100644 index 000000000000..fc2c3146517f --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/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_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appplatform.v2020_07_01.RuntimeVersions; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.appplatform.v2020_07_01.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_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/RuntimeVersionsInner.java b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/RuntimeVersionsInner.java new file mode 100644 index 000000000000..66e94d612510 --- /dev/null +++ b/sdk/appplatform/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/appplatform/v2020_07_01/implementation/RuntimeVersionsInner.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.appplatform.v2020_07_01.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_07_01.RuntimeVersions listRuntimeVersions" }) + @GET("providers/Microsoft.AppPlatform/runtimeVersions") + Observable> listRuntimeVersions(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailableRuntimeVersionsInner object if successful. + */ + public AvailableRuntimeVersionsInner listRuntimeVersions() { + return listRuntimeVersionsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listRuntimeVersionsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRuntimeVersionsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailableRuntimeVersionsInner object + */ + public Observable listRuntimeVersionsAsync() { + return listRuntimeVersionsWithServiceResponseAsync().map(new Func1, AvailableRuntimeVersionsInner>() { + @Override + public AvailableRuntimeVersionsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailableRuntimeVersionsInner object + */ + public Observable> listRuntimeVersionsWithServiceResponseAsync() { + return service.listRuntimeVersions(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listRuntimeVersionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listRuntimeVersionsDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +}