diff --git a/devspaces/resource-manager/v2018_06_01_preview/pom.xml b/devspaces/resource-manager/v2018_06_01_preview/pom.xml index e4c4b6b18c3b..549212c2d9ee 100644 --- a/devspaces/resource-manager/v2018_06_01_preview/pom.xml +++ b/devspaces/resource-manager/v2018_06_01_preview/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 1.0.0 + 0.0.3-beta ../../../pom.xml azure-mgmt-devspaces @@ -19,7 +19,7 @@ jar Microsoft Azure SDK for DevSpaces Management This package contains Microsoft DevSpaces Management SDK. - https://github.com/Azure/azure-libraries-for-java + https://github.com/Azure/azure-sdk-for-java The MIT License (MIT) @@ -28,8 +28,8 @@ - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD diff --git a/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/ContainerHostMappings.java b/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/ContainerHostMappings.java new file mode 100644 index 000000000000..1406b254bc24 --- /dev/null +++ b/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/ContainerHostMappings.java @@ -0,0 +1,28 @@ +/** + * 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.devspaces.v2018_06_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.devspaces.v2018_06_01_preview.implementation.ContainerHostMappingsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerHostMappings. + */ +public interface ContainerHostMappings extends HasInner { + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param location Location of the container host. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getContainerHostMappingAsync(String location); + +} diff --git a/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/Controller.java b/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/Controller.java index 6c4e58889a83..7bc59f89238f 100644 --- a/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/Controller.java +++ b/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/Controller.java @@ -82,7 +82,9 @@ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup implements ContainerHostMappings { + private final DevSpacesManager manager; + + ContainerHostMappingsImpl(DevSpacesManager manager) { + super(manager.inner().containerHostMappings()); + this.manager = manager; + } + + public DevSpacesManager manager() { + return this.manager; + } + + @Override + public Observable getContainerHostMappingAsync(String location) { + ContainerHostMappingsInner client = this.inner(); + return client.getContainerHostMappingAsync(location) + ;} + +} diff --git a/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ContainerHostMappingsInner.java b/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ContainerHostMappingsInner.java new file mode 100644 index 000000000000..954288dc1660 --- /dev/null +++ b/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ContainerHostMappingsInner.java @@ -0,0 +1,215 @@ +/** + * 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.devspaces.v2018_06_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.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +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 ContainerHostMappings. + */ +public class ContainerHostMappingsInner { + /** The Retrofit service to perform REST calls. */ + private ContainerHostMappingsService service; + /** The service client containing this operation class. */ + private DevSpacesManagementClientImpl client; + + /** + * Initializes an instance of ContainerHostMappingsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerHostMappingsInner(Retrofit retrofit, DevSpacesManagementClientImpl client) { + this.service = retrofit.create(ContainerHostMappingsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerHostMappings to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerHostMappingsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.devspaces.v2018_06_01_preview.ContainerHostMappings getContainerHostMapping" }) + @POST("providers/Microsoft.DevSpaces/locations/{location}/checkContainerHostMapping") + Observable> getContainerHostMapping(@Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ContainerHostMappingInner containerHostMapping, @Header("User-Agent") String userAgent); + + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param location Location of the container host. + * @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 Object object if successful. + */ + public Object getContainerHostMapping(String location) { + return getContainerHostMappingWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param location Location of the container host. + * @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 getContainerHostMappingAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getContainerHostMappingWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param location Location of the container host. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable getContainerHostMappingAsync(String location) { + return getContainerHostMappingWithServiceResponseAsync(location).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param location Location of the container host. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> getContainerHostMappingWithServiceResponseAsync(String location) { + 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."); + } + final String containerHostResourceId = null; + ContainerHostMappingInner containerHostMapping = new ContainerHostMappingInner(); + containerHostMapping.withContainerHostResourceId(null); + return service.getContainerHostMapping(location, this.client.apiVersion(), this.client.acceptLanguage(), containerHostMapping, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getContainerHostMappingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param location Location of the container host. + * @param containerHostResourceId ARM ID of the Container Host 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 Object object if successful. + */ + public Object getContainerHostMapping(String location, String containerHostResourceId) { + return getContainerHostMappingWithServiceResponseAsync(location, containerHostResourceId).toBlocking().single().body(); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param location Location of the container host. + * @param containerHostResourceId ARM ID of the Container Host 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 getContainerHostMappingAsync(String location, String containerHostResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getContainerHostMappingWithServiceResponseAsync(location, containerHostResourceId), serviceCallback); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param location Location of the container host. + * @param containerHostResourceId ARM ID of the Container Host resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable getContainerHostMappingAsync(String location, String containerHostResourceId) { + return getContainerHostMappingWithServiceResponseAsync(location, containerHostResourceId).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param location Location of the container host. + * @param containerHostResourceId ARM ID of the Container Host resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> getContainerHostMappingWithServiceResponseAsync(String location, String containerHostResourceId) { + 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."); + } + ContainerHostMappingInner containerHostMapping = new ContainerHostMappingInner(); + containerHostMapping.withContainerHostResourceId(containerHostResourceId); + return service.getContainerHostMapping(location, this.client.apiVersion(), this.client.acceptLanguage(), containerHostMapping, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getContainerHostMappingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getContainerHostMappingDelegate(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/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ControllerInner.java b/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ControllerInner.java index cc3786bf31dc..7ee73b313840 100644 --- a/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ControllerInner.java +++ b/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ControllerInner.java @@ -24,7 +24,7 @@ public class ControllerInner extends Resource { /** * Provisioning state of the Azure Dev Spaces Controller. Possible values * include: 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating', - * 'Deleting'. + * 'Deleting', 'Deleted'. */ @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; @@ -61,7 +61,7 @@ public class ControllerInner extends Resource { private Sku sku; /** - * Get provisioning state of the Azure Dev Spaces Controller. Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating', 'Deleting'. + * Get provisioning state of the Azure Dev Spaces Controller. Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating', 'Deleting', 'Deleted'. * * @return the provisioningState value */ diff --git a/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/DevSpacesManagementClientImpl.java b/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/DevSpacesManagementClientImpl.java index f1de18d6179a..558e3a6263b7 100644 --- a/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/DevSpacesManagementClientImpl.java +++ b/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/DevSpacesManagementClientImpl.java @@ -63,11 +63,11 @@ public String apiVersion() { return this.apiVersion; } - /** Gets or sets the preferred language for the response. */ + /** The preferred language for the response. */ private String acceptLanguage; /** - * Gets Gets or sets the preferred language for the response. + * Gets The preferred language for the response. * * @return the acceptLanguage value. */ @@ -76,7 +76,7 @@ public String acceptLanguage() { } /** - * Sets Gets or sets the preferred language for the response. + * Sets The preferred language for the response. * * @param acceptLanguage the acceptLanguage value. * @return the service client itself @@ -86,11 +86,11 @@ public DevSpacesManagementClientImpl withAcceptLanguage(String acceptLanguage) { return this; } - /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ private int longRunningOperationRetryTimeout; /** - * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @return the longRunningOperationRetryTimeout value. */ @@ -99,7 +99,7 @@ public int longRunningOperationRetryTimeout() { } /** - * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself @@ -109,11 +109,11 @@ public DevSpacesManagementClientImpl withLongRunningOperationRetryTimeout(int lo return this; } - /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + /** 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 When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * 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. */ @@ -122,7 +122,7 @@ public boolean generateClientRequestId() { } /** - * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * 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 @@ -132,6 +132,19 @@ public DevSpacesManagementClientImpl withGenerateClientRequestId(boolean generat return this; } + /** + * The ContainerHostMappingsInner object to access its operations. + */ + private ContainerHostMappingsInner containerHostMappings; + + /** + * Gets the ContainerHostMappingsInner object to access its operations. + * @return the ContainerHostMappingsInner object. + */ + public ContainerHostMappingsInner containerHostMappings() { + return this.containerHostMappings; + } + /** * The ControllersInner object to access its operations. */ @@ -193,6 +206,7 @@ protected void initialize() { this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; + this.containerHostMappings = new ContainerHostMappingsInner(restClient().retrofit(), this); this.controllers = new ControllersInner(restClient().retrofit(), this); this.operations = new OperationsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); @@ -205,6 +219,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "DevSpacesManagementClient", "2018-06-01-preview"); + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "DevSpacesManagementClient", "2018-06-01-preview"); } } diff --git a/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/DevSpacesManager.java b/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/DevSpacesManager.java index 6f381b252148..db51ecc17b64 100644 --- a/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/DevSpacesManager.java +++ b/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/DevSpacesManager.java @@ -16,6 +16,7 @@ import com.microsoft.azure.arm.resources.AzureConfigurable; import com.microsoft.azure.serializer.AzureJacksonAdapter; import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.devspaces.v2018_06_01_preview.ContainerHostMappings; import com.microsoft.azure.management.devspaces.v2018_06_01_preview.Controllers; import com.microsoft.azure.management.devspaces.v2018_06_01_preview.Operations; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; @@ -25,6 +26,7 @@ * Entry point to Azure DevSpaces resource management. */ public final class DevSpacesManager extends ManagerCore { + private ContainerHostMappings containerHostMappings; private Controllers controllers; private Operations operations; /** @@ -74,6 +76,16 @@ public interface Configurable extends AzureConfigurable { DevSpacesManager authenticate(AzureTokenCredentials credentials, String subscriptionId); } + /** + * @return Entry point to manage ContainerHostMappings. + */ + public ContainerHostMappings containerHostMappings() { + if (this.containerHostMappings == null) { + this.containerHostMappings = new ContainerHostMappingsImpl(this); + } + return this.containerHostMappings; + } + /** * @return Entry point to manage Controllers. */ diff --git a/devspaces/resource-manager/v2019_01_01_preview/pom.xml b/devspaces/resource-manager/v2019_01_01_preview/pom.xml new file mode 100644 index 000000000000..c4d2f2ada846 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.devspaces.v2019_01_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-devspaces + 1.0.0-beta + jar + Microsoft Azure SDK for DevSpaces Management + This package contains Microsoft DevSpaces 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 + + + + + + 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/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ContainerHostMappings.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ContainerHostMappings.java new file mode 100644 index 000000000000..473d5a2ad5b3 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ContainerHostMappings.java @@ -0,0 +1,29 @@ +/** + * 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.devspaces.v2019_01_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.implementation.ContainerHostMappingsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerHostMappings. + */ +public interface ContainerHostMappings extends HasInner { + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getContainerHostMappingAsync(String resourceGroupName, String location); + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/Controller.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/Controller.java new file mode 100644 index 000000000000..a7e459cda198 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/Controller.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.devspaces.v2019_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +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.devspaces.v2019_01_01_preview.implementation.DevSpacesManager; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.implementation.ControllerInner; + +/** + * Type representing Controller. + */ +public interface Controller extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dataPlaneFqdn value. + */ + String dataPlaneFqdn(); + + /** + * @return the hostSuffix value. + */ + String hostSuffix(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the targetContainerHostCredentialsBase64 value. + */ + String targetContainerHostCredentialsBase64(); + + /** + * @return the targetContainerHostResourceId value. + */ + String targetContainerHostResourceId(); + + /** + * The entirety of the Controller definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithSku, DefinitionStages.WithTargetContainerHostCredentialsBase64, DefinitionStages.WithTargetContainerHostResourceId, DefinitionStages.WithCreate { + } + + /** + * Grouping of Controller definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Controller definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Controller definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the controller definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku the sku parameter value + * @return the next definition stage +*/ + WithTargetContainerHostCredentialsBase64 withSku(Sku sku); + } + + /** + * The stage of the controller definition allowing to specify TargetContainerHostCredentialsBase64. + */ + interface WithTargetContainerHostCredentialsBase64 { + /** + * Specifies targetContainerHostCredentialsBase64. + * @param targetContainerHostCredentialsBase64 Credentials of the target container host (base64) + * @return the next definition stage +*/ + WithTargetContainerHostResourceId withTargetContainerHostCredentialsBase64(String targetContainerHostCredentialsBase64); + } + + /** + * The stage of the controller definition allowing to specify TargetContainerHostResourceId. + */ + interface WithTargetContainerHostResourceId { + /** + * Specifies targetContainerHostResourceId. + * @param targetContainerHostResourceId Resource ID of the target container host + * @return the next definition stage +*/ + WithCreate withTargetContainerHostResourceId(String targetContainerHostResourceId); + } + + /** + * 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, Resource.DefinitionWithTags { + } + } + /** + * The template for a Controller update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of Controller update stages. + */ + interface UpdateStages { + } +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ControllerConnectionDetails.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ControllerConnectionDetails.java new file mode 100644 index 000000000000..e2a27f2c5323 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ControllerConnectionDetails.java @@ -0,0 +1,58 @@ +/** + * 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.devspaces.v2019_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ControllerConnectionDetails model. + */ +public class ControllerConnectionDetails { + /** + * Authentication key for communicating with services. + */ + @JsonProperty(value = "authKey", access = JsonProperty.Access.WRITE_ONLY) + private String authKey; + + /** + * The orchestratorSpecificConnectionDetails property. + */ + @JsonProperty(value = "orchestratorSpecificConnectionDetails") + private OrchestratorSpecificConnectionDetails orchestratorSpecificConnectionDetails; + + /** + * Get authentication key for communicating with services. + * + * @return the authKey value + */ + public String authKey() { + return this.authKey; + } + + /** + * Get the orchestratorSpecificConnectionDetails value. + * + * @return the orchestratorSpecificConnectionDetails value + */ + public OrchestratorSpecificConnectionDetails orchestratorSpecificConnectionDetails() { + return this.orchestratorSpecificConnectionDetails; + } + + /** + * Set the orchestratorSpecificConnectionDetails value. + * + * @param orchestratorSpecificConnectionDetails the orchestratorSpecificConnectionDetails value to set + * @return the ControllerConnectionDetails object itself. + */ + public ControllerConnectionDetails withOrchestratorSpecificConnectionDetails(OrchestratorSpecificConnectionDetails orchestratorSpecificConnectionDetails) { + this.orchestratorSpecificConnectionDetails = orchestratorSpecificConnectionDetails; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ControllerConnectionDetailsList.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ControllerConnectionDetailsList.java new file mode 100644 index 000000000000..ab2cc09cc775 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ControllerConnectionDetailsList.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.devspaces.v2019_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.implementation.DevSpacesManager; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.implementation.ControllerConnectionDetailsListInner; +import java.util.List; + +/** + * Type representing ControllerConnectionDetailsList. + */ +public interface ControllerConnectionDetailsList extends HasInner, HasManager { + /** + * @return the connectionDetailsList value. + */ + List connectionDetailsList(); + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ControllerUpdateParameters.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ControllerUpdateParameters.java new file mode 100644 index 000000000000..814059b16b95 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ControllerUpdateParameters.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.devspaces.v2019_01_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for updating an Azure Dev Spaces Controller. + */ +public class ControllerUpdateParameters { + /** + * Tags for the Azure Dev Spaces Controller. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get tags for the Azure Dev Spaces Controller. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set tags for the Azure Dev Spaces Controller. + * + * @param tags the tags value to set + * @return the ControllerUpdateParameters object itself. + */ + public ControllerUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/Controllers.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/Controllers.java new file mode 100644 index 000000000000..f380b2f67213 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/Controllers.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.devspaces.v2019_01_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.implementation.ControllersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Controllers. + */ +public interface Controllers extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Lists connection details for an Azure Dev Spaces Controller. + * Lists connection details for the underlying container resources of an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listConnectionDetailsAsync(String resourceGroupName, String name); + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ErrorDetails.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ErrorDetails.java new file mode 100644 index 000000000000..7b6fae6bf4ed --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ErrorDetails.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.devspaces.v2019_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ErrorDetails model. + */ +public class ErrorDetails { + /** + * Status code for the error. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Error message describing the error in detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The target of the particular error. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * Get status code for the error. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get error message describing the error in detail. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the target of the particular error. + * + * @return the target value + */ + public String target() { + return this.target; + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ErrorResponse.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ErrorResponse.java new file mode 100644 index 000000000000..50e9b401984f --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ErrorResponse.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.devspaces.v2019_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response indicates that the service is not able to process the + * incoming request. The reason is provided in the error message. + */ +public class ErrorResponse { + /** + * The details of the error. + */ + @JsonProperty(value = "error") + private ErrorDetails error; + + /** + * Get the details of the error. + * + * @return the error value + */ + public ErrorDetails error() { + return this.error; + } + + /** + * Set the details of the error. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorDetails error) { + this.error = error; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ErrorResponseException.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ErrorResponseException.java new file mode 100644 index 000000000000..1e9f4aeb1900 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ErrorResponseException.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.devspaces.v2019_01_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/KubernetesConnectionDetails.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/KubernetesConnectionDetails.java new file mode 100644 index 000000000000..94801840576e --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/KubernetesConnectionDetails.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.devspaces.v2019_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Contains information used to connect to a Kubernetes cluster. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("Kubernetes") +public class KubernetesConnectionDetails extends OrchestratorSpecificConnectionDetails { + /** + * Gets the kubeconfig for the cluster. + */ + @JsonProperty(value = "kubeConfig") + private String kubeConfig; + + /** + * Get gets the kubeconfig for the cluster. + * + * @return the kubeConfig value + */ + public String kubeConfig() { + return this.kubeConfig; + } + + /** + * Set gets the kubeconfig for the cluster. + * + * @param kubeConfig the kubeConfig value to set + * @return the KubernetesConnectionDetails object itself. + */ + public KubernetesConnectionDetails withKubeConfig(String kubeConfig) { + this.kubeConfig = kubeConfig; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/Operations.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/Operations.java new file mode 100644 index 000000000000..4d8cc9bdd97d --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/Operations.java @@ -0,0 +1,28 @@ +/** + * 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.devspaces.v2019_01_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/OrchestratorSpecificConnectionDetails.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/OrchestratorSpecificConnectionDetails.java new file mode 100644 index 000000000000..45f6b25378e7 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/OrchestratorSpecificConnectionDetails.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.devspaces.v2019_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for types that supply values used to connect to container + * orchestrators. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("OrchestratorSpecificConnectionDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Kubernetes", value = KubernetesConnectionDetails.class) +}) +public class OrchestratorSpecificConnectionDetails { +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ProvisioningState.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ProvisioningState.java new file mode 100644 index 000000000000..b82cbbc7fb71 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ProvisioningState.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.devspaces.v2019_01_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 Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** + * 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/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ResourceProviderOperationDefinition.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ResourceProviderOperationDefinition.java new file mode 100644 index 000000000000..0ed4d2414c64 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ResourceProviderOperationDefinition.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.devspaces.v2019_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.implementation.DevSpacesManager; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.implementation.ResourceProviderOperationDefinitionInner; + +/** + * Type representing ResourceProviderOperationDefinition. + */ +public interface ResourceProviderOperationDefinition extends HasInner, HasManager { + /** + * @return the display value. + */ + ResourceProviderOperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ResourceProviderOperationDisplay.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ResourceProviderOperationDisplay.java new file mode 100644 index 000000000000..3602ba8ae6ac --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/ResourceProviderOperationDisplay.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.devspaces.v2019_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ResourceProviderOperationDisplay model. + */ +public class ResourceProviderOperationDisplay { + /** + * Name of the resource provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Name of the resource type. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Name of the resource provider operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the resource provider operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get name of the resource provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set name of the resource provider. + * + * @param provider the provider value to set + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get name of the resource type. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set name of the resource type. + * + * @param resource the resource value to set + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get name of the resource provider operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set name of the resource provider operation. + * + * @param operation the operation value to set + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the resource provider operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the resource provider operation. + * + * @param description the description value to set + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/Sku.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/Sku.java new file mode 100644 index 000000000000..a1d0962f670f --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/Sku.java @@ -0,0 +1,77 @@ +/** + * 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.devspaces.v2019_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Model representing SKU for Azure Dev Spaces Controller. + */ +public class Sku { + /** + * The name of the SKU for Azure Dev Spaces Controller. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The tier of the SKU for Azure Dev Spaces Controller. Possible values + * include: 'Standard'. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /** + * Creates an instance of Sku class. + */ + public Sku() { + name = "S1"; + } + + /** + * Get the name of the SKU for Azure Dev Spaces Controller. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU for Azure Dev Spaces Controller. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier of the SKU for Azure Dev Spaces Controller. Possible values include: 'Standard'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set the tier of the SKU for Azure Dev Spaces Controller. Possible values include: 'Standard'. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/SkuTier.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/SkuTier.java new file mode 100644 index 000000000000..77c04ed335a4 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/SkuTier.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.devspaces.v2019_01_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuTier. + */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Standard for SkuTier. */ + public static final SkuTier STANDARD = fromString("Standard"); + + /** + * Creates or finds a SkuTier from its string representation. + * @param name a name to look for + * @return the corresponding SkuTier + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** + * @return known SkuTier values + */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ContainerHostMappingInner.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ContainerHostMappingInner.java new file mode 100644 index 000000000000..a07e30d388c6 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ContainerHostMappingInner.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.devspaces.v2019_01_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Container host mapping object specifying the Container host resource ID and + * its associated Controller resource. + */ +public class ContainerHostMappingInner { + /** + * ARM ID of the Container Host resource. + */ + @JsonProperty(value = "containerHostResourceId") + private String containerHostResourceId; + + /** + * ARM ID of the mapped Controller resource. + */ + @JsonProperty(value = "mappedControllerResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String mappedControllerResourceId; + + /** + * Get aRM ID of the Container Host resource. + * + * @return the containerHostResourceId value + */ + public String containerHostResourceId() { + return this.containerHostResourceId; + } + + /** + * Set aRM ID of the Container Host resource. + * + * @param containerHostResourceId the containerHostResourceId value to set + * @return the ContainerHostMappingInner object itself. + */ + public ContainerHostMappingInner withContainerHostResourceId(String containerHostResourceId) { + this.containerHostResourceId = containerHostResourceId; + return this; + } + + /** + * Get aRM ID of the mapped Controller resource. + * + * @return the mappedControllerResourceId value + */ + public String mappedControllerResourceId() { + return this.mappedControllerResourceId; + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ContainerHostMappingsImpl.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ContainerHostMappingsImpl.java new file mode 100644 index 000000000000..7b1bac893347 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ContainerHostMappingsImpl.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. + * abc + */ + +package com.microsoft.azure.management.devspaces.v2019_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.ContainerHostMappings; +import rx.functions.Func1; +import rx.Observable; + +class ContainerHostMappingsImpl extends WrapperImpl implements ContainerHostMappings { + private final DevSpacesManager manager; + + ContainerHostMappingsImpl(DevSpacesManager manager) { + super(manager.inner().containerHostMappings()); + this.manager = manager; + } + + public DevSpacesManager manager() { + return this.manager; + } + + @Override + public Observable getContainerHostMappingAsync(String resourceGroupName, String location) { + ContainerHostMappingsInner client = this.inner(); + return client.getContainerHostMappingAsync(resourceGroupName, location) + ;} + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ContainerHostMappingsInner.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ContainerHostMappingsInner.java new file mode 100644 index 000000000000..ccd20670c6d6 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ContainerHostMappingsInner.java @@ -0,0 +1,235 @@ +/** + * 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.devspaces.v2019_01_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.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +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 ContainerHostMappings. + */ +public class ContainerHostMappingsInner { + /** The Retrofit service to perform REST calls. */ + private ContainerHostMappingsService service; + /** The service client containing this operation class. */ + private DevSpacesManagementClientImpl client; + + /** + * Initializes an instance of ContainerHostMappingsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerHostMappingsInner(Retrofit retrofit, DevSpacesManagementClientImpl client) { + this.service = retrofit.create(ContainerHostMappingsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerHostMappings to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerHostMappingsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.devspaces.v2019_01_01_preview.ContainerHostMappings getContainerHostMapping" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/locations/{location}/checkContainerHostMapping") + Observable> getContainerHostMapping(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ContainerHostMappingInner containerHostMapping, @Header("User-Agent") String userAgent); + + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @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 Object object if successful. + */ + public Object getContainerHostMapping(String resourceGroupName, String location) { + return getContainerHostMappingWithServiceResponseAsync(resourceGroupName, location).toBlocking().single().body(); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @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 getContainerHostMappingAsync(String resourceGroupName, String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getContainerHostMappingWithServiceResponseAsync(resourceGroupName, location), serviceCallback); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable getContainerHostMappingAsync(String resourceGroupName, String location) { + return getContainerHostMappingWithServiceResponseAsync(resourceGroupName, location).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> getContainerHostMappingWithServiceResponseAsync(String resourceGroupName, String location) { + 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 (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."); + } + final String containerHostResourceId = null; + ContainerHostMappingInner containerHostMapping = new ContainerHostMappingInner(); + containerHostMapping.withContainerHostResourceId(null); + return service.getContainerHostMapping(this.client.subscriptionId(), resourceGroupName, location, this.client.apiVersion(), this.client.acceptLanguage(), containerHostMapping, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getContainerHostMappingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @param containerHostResourceId ARM ID of the Container Host 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 Object object if successful. + */ + public Object getContainerHostMapping(String resourceGroupName, String location, String containerHostResourceId) { + return getContainerHostMappingWithServiceResponseAsync(resourceGroupName, location, containerHostResourceId).toBlocking().single().body(); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @param containerHostResourceId ARM ID of the Container Host 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 getContainerHostMappingAsync(String resourceGroupName, String location, String containerHostResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getContainerHostMappingWithServiceResponseAsync(resourceGroupName, location, containerHostResourceId), serviceCallback); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @param containerHostResourceId ARM ID of the Container Host resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable getContainerHostMappingAsync(String resourceGroupName, String location, String containerHostResourceId) { + return getContainerHostMappingWithServiceResponseAsync(resourceGroupName, location, containerHostResourceId).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @param containerHostResourceId ARM ID of the Container Host resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> getContainerHostMappingWithServiceResponseAsync(String resourceGroupName, String location, String containerHostResourceId) { + 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 (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."); + } + ContainerHostMappingInner containerHostMapping = new ContainerHostMappingInner(); + containerHostMapping.withContainerHostResourceId(containerHostResourceId); + return service.getContainerHostMapping(this.client.subscriptionId(), resourceGroupName, location, this.client.apiVersion(), this.client.acceptLanguage(), containerHostMapping, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getContainerHostMappingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getContainerHostMappingDelegate(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/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllerConnectionDetailsListImpl.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllerConnectionDetailsListImpl.java new file mode 100644 index 000000000000..aad79f933bc4 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllerConnectionDetailsListImpl.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.devspaces.v2019_01_01_preview.implementation; + +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.ControllerConnectionDetailsList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.ControllerConnectionDetails; + +class ControllerConnectionDetailsListImpl extends WrapperImpl implements ControllerConnectionDetailsList { + private final DevSpacesManager manager; + ControllerConnectionDetailsListImpl(ControllerConnectionDetailsListInner inner, DevSpacesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevSpacesManager manager() { + return this.manager; + } + + @Override + public List connectionDetailsList() { + return this.inner().connectionDetailsList(); + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllerConnectionDetailsListInner.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllerConnectionDetailsListInner.java new file mode 100644 index 000000000000..f67b6ca18cd1 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllerConnectionDetailsListInner.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.devspaces.v2019_01_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.ControllerConnectionDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ControllerConnectionDetailsListInner model. + */ +public class ControllerConnectionDetailsListInner { + /** + * List of Azure Dev Spaces Controller connection details. + */ + @JsonProperty(value = "connectionDetailsList") + private List connectionDetailsList; + + /** + * Get list of Azure Dev Spaces Controller connection details. + * + * @return the connectionDetailsList value + */ + public List connectionDetailsList() { + return this.connectionDetailsList; + } + + /** + * Set list of Azure Dev Spaces Controller connection details. + * + * @param connectionDetailsList the connectionDetailsList value to set + * @return the ControllerConnectionDetailsListInner object itself. + */ + public ControllerConnectionDetailsListInner withConnectionDetailsList(List connectionDetailsList) { + this.connectionDetailsList = connectionDetailsList; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllerImpl.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllerImpl.java new file mode 100644 index 000000000000..fadd1416c92a --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllerImpl.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.devspaces.v2019_01_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.Controller; +import rx.Observable; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.ProvisioningState; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.Sku; + +class ControllerImpl extends GroupableResourceCoreImpl implements Controller, Controller.Definition, Controller.Update { + ControllerImpl(String name, ControllerInner inner, DevSpacesManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ControllersInner client = this.manager().inner().controllers(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ControllersInner client = this.manager().inner().controllers(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ControllersInner client = this.manager().inner().controllers(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String dataPlaneFqdn() { + return this.inner().dataPlaneFqdn(); + } + + @Override + public String hostSuffix() { + return this.inner().hostSuffix(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public String targetContainerHostCredentialsBase64() { + return this.inner().targetContainerHostCredentialsBase64(); + } + + @Override + public String targetContainerHostResourceId() { + return this.inner().targetContainerHostResourceId(); + } + + @Override + public ControllerImpl withSku(Sku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public ControllerImpl withTargetContainerHostCredentialsBase64(String targetContainerHostCredentialsBase64) { + this.inner().withTargetContainerHostCredentialsBase64(targetContainerHostCredentialsBase64); + return this; + } + + @Override + public ControllerImpl withTargetContainerHostResourceId(String targetContainerHostResourceId) { + this.inner().withTargetContainerHostResourceId(targetContainerHostResourceId); + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllerInner.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllerInner.java new file mode 100644 index 000000000000..d1d539e814e5 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllerInner.java @@ -0,0 +1,150 @@ +/** + * 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.devspaces.v2019_01_01_preview.implementation; + +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.ProvisioningState; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The ControllerInner model. + */ +@JsonFlatten +@SkipParentValidation +public class ControllerInner extends Resource { + /** + * Provisioning state of the Azure Dev Spaces Controller. Possible values + * include: 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating', + * 'Deleting', 'Deleted'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * DNS suffix for public endpoints running in the Azure Dev Spaces + * Controller. + */ + @JsonProperty(value = "properties.hostSuffix", access = JsonProperty.Access.WRITE_ONLY) + private String hostSuffix; + + /** + * DNS name for accessing DataPlane services. + */ + @JsonProperty(value = "properties.dataPlaneFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String dataPlaneFqdn; + + /** + * Resource ID of the target container host. + */ + @JsonProperty(value = "properties.targetContainerHostResourceId", required = true) + private String targetContainerHostResourceId; + + /** + * Credentials of the target container host (base64). + */ + @JsonProperty(value = "properties.targetContainerHostCredentialsBase64", required = true) + private String targetContainerHostCredentialsBase64; + + /** + * The sku property. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * Get provisioning state of the Azure Dev Spaces Controller. Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating', 'Deleting', 'Deleted'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get dNS suffix for public endpoints running in the Azure Dev Spaces Controller. + * + * @return the hostSuffix value + */ + public String hostSuffix() { + return this.hostSuffix; + } + + /** + * Get dNS name for accessing DataPlane services. + * + * @return the dataPlaneFqdn value + */ + public String dataPlaneFqdn() { + return this.dataPlaneFqdn; + } + + /** + * Get resource ID of the target container host. + * + * @return the targetContainerHostResourceId value + */ + public String targetContainerHostResourceId() { + return this.targetContainerHostResourceId; + } + + /** + * Set resource ID of the target container host. + * + * @param targetContainerHostResourceId the targetContainerHostResourceId value to set + * @return the ControllerInner object itself. + */ + public ControllerInner withTargetContainerHostResourceId(String targetContainerHostResourceId) { + this.targetContainerHostResourceId = targetContainerHostResourceId; + return this; + } + + /** + * Get credentials of the target container host (base64). + * + * @return the targetContainerHostCredentialsBase64 value + */ + public String targetContainerHostCredentialsBase64() { + return this.targetContainerHostCredentialsBase64; + } + + /** + * Set credentials of the target container host (base64). + * + * @param targetContainerHostCredentialsBase64 the targetContainerHostCredentialsBase64 value to set + * @return the ControllerInner object itself. + */ + public ControllerInner withTargetContainerHostCredentialsBase64(String targetContainerHostCredentialsBase64) { + this.targetContainerHostCredentialsBase64 = targetContainerHostCredentialsBase64; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the ControllerInner object itself. + */ + public ControllerInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllersImpl.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllersImpl.java new file mode 100644 index 000000000000..bef734d8bc3e --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllersImpl.java @@ -0,0 +1,151 @@ +/** + * 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. + * def + */ + +package com.microsoft.azure.management.devspaces.v2019_01_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.Controllers; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.Controller; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.ControllerConnectionDetailsList; + +class ControllersImpl extends GroupableResourcesCoreImpl implements Controllers { + protected ControllersImpl(DevSpacesManager manager) { + super(manager.inner().controllers(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ControllersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ControllersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ControllersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ControllersInner 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 Controller call(ControllerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ControllersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ControllersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Controller call(ControllerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ControllerImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listConnectionDetailsAsync(String resourceGroupName, String name) { + ControllersInner client = this.inner(); + return client.listConnectionDetailsAsync(resourceGroupName, name) + .map(new Func1() { + @Override + public ControllerConnectionDetailsList call(ControllerConnectionDetailsListInner inner) { + return new ControllerConnectionDetailsListImpl(inner, manager()); + } + }); + } + + @Override + protected ControllerImpl wrapModel(ControllerInner inner) { + return new ControllerImpl(inner.name(), inner, manager()); + } + + @Override + protected ControllerImpl wrapModel(String name) { + return new ControllerImpl(name, new ControllerInner(), this.manager()); + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllersInner.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllersInner.java new file mode 100644 index 000000000000..30bc0e916411 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ControllersInner.java @@ -0,0 +1,1287 @@ +/** + * 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.devspaces.v2019_01_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.ListOperationCallback; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.ControllerUpdateParameters; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.ErrorResponseException; +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 java.util.Map; +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 Controllers. + */ +public class ControllersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ControllersService service; + /** The service client containing this operation class. */ + private DevSpacesManagementClientImpl client; + + /** + * Initializes an instance of ControllersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ControllersInner(Retrofit retrofit, DevSpacesManagementClientImpl client) { + this.service = retrofit.create(ControllersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Controllers to be + * used by Retrofit to perform actually REST calls. + */ + interface ControllersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.devspaces.v2019_01_01_preview.Controllers getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @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.devspaces.v2019_01_01_preview.Controllers create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Body ControllerInner controller, @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.devspaces.v2019_01_01_preview.Controllers beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Body ControllerInner controller, @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.devspaces.v2019_01_01_preview.Controllers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @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.devspaces.v2019_01_01_preview.Controllers beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @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.devspaces.v2019_01_01_preview.Controllers update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ControllerUpdateParameters controllerUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.devspaces.v2019_01_01_preview.Controllers listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers") + 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.devspaces.v2019_01_01_preview.Controllers list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers") + 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.devspaces.v2019_01_01_preview.Controllers listConnectionDetails" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}/listConnectionDetails") + Observable> listConnectionDetails(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @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.devspaces.v2019_01_01_preview.Controllers listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@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.devspaces.v2019_01_01_preview.Controllers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets an Azure Dev Spaces Controller. + * Gets the properties for an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ControllerInner object if successful. + */ + public ControllerInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); + } + + /** + * Gets an Azure Dev Spaces Controller. + * Gets the properties for an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the 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 name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets an Azure Dev Spaces Controller. + * Gets the properties for an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name).map(new Func1, ControllerInner>() { + @Override + public ControllerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an Azure Dev Spaces Controller. + * Gets the properties for an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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, name, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ControllerInner object if successful. + */ + public ControllerInner create(String resourceGroupName, String name, ControllerInner controller) { + return createWithServiceResponseAsync(resourceGroupName, name, controller).toBlocking().last().body(); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @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 createAsync(String resourceGroupName, String name, ControllerInner controller, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, name, controller), serviceCallback); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String name, ControllerInner controller) { + return createWithServiceResponseAsync(resourceGroupName, name, controller).map(new Func1, ControllerInner>() { + @Override + public ControllerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String name, ControllerInner controller) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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 (controller == null) { + throw new IllegalArgumentException("Parameter controller is required and cannot be null."); + } + Validator.validate(controller); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), controller, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ControllerInner object if successful. + */ + public ControllerInner beginCreate(String resourceGroupName, String name, ControllerInner controller) { + return beginCreateWithServiceResponseAsync(resourceGroupName, name, controller).toBlocking().single().body(); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @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 beginCreateAsync(String resourceGroupName, String name, ControllerInner controller, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, name, controller), serviceCallback); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String name, ControllerInner controller) { + return beginCreateWithServiceResponseAsync(resourceGroupName, name, controller).map(new Func1, ControllerInner>() { + @Override + public ControllerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String name, ControllerInner controller) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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 (controller == null) { + throw new IllegalArgumentException("Parameter controller is required and cannot be null."); + } + Validator.validate(controller); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), controller, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 name) { + deleteWithServiceResponseAsync(resourceGroupName, name).toBlocking().last().body(); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the 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 name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String name) { + return deleteWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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, name, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 name) { + beginDeleteWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the 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 name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String name) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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, name, 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 ErrorResponseException, 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(ErrorResponseException.class) + .build(response); + } + + /** + * Updates an Azure Dev Spaces Controller. + * Updates the properties of an existing Azure Dev Spaces Controller with the specified update parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ControllerInner object if successful. + */ + public ControllerInner update(String resourceGroupName, String name) { + return updateWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); + } + + /** + * Updates an Azure Dev Spaces Controller. + * Updates the properties of an existing Azure Dev Spaces Controller with the specified update parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the 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 name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Updates an Azure Dev Spaces Controller. + * Updates the properties of an existing Azure Dev Spaces Controller with the specified update parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerInner object + */ + public Observable updateAsync(String resourceGroupName, String name) { + return updateWithServiceResponseAsync(resourceGroupName, name).map(new Func1, ControllerInner>() { + @Override + public ControllerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an Azure Dev Spaces Controller. + * Updates the properties of an existing Azure Dev Spaces Controller with the specified update parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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 Map tags = null; + ControllerUpdateParameters controllerUpdateParameters = new ControllerUpdateParameters(); + controllerUpdateParameters.withTags(null); + return service.update(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), this.client.acceptLanguage(), controllerUpdateParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an Azure Dev Spaces Controller. + * Updates the properties of an existing Azure Dev Spaces Controller with the specified update parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param tags Tags for the Azure Dev Spaces Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ControllerInner object if successful. + */ + public ControllerInner update(String resourceGroupName, String name, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, name, tags).toBlocking().single().body(); + } + + /** + * Updates an Azure Dev Spaces Controller. + * Updates the properties of an existing Azure Dev Spaces Controller with the specified update parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param tags Tags for the Azure Dev Spaces Controller. + * @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 name, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, name, tags), serviceCallback); + } + + /** + * Updates an Azure Dev Spaces Controller. + * Updates the properties of an existing Azure Dev Spaces Controller with the specified update parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param tags Tags for the Azure Dev Spaces Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerInner object + */ + public Observable updateAsync(String resourceGroupName, String name, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, name, tags).map(new Func1, ControllerInner>() { + @Override + public ControllerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an Azure Dev Spaces Controller. + * Updates the properties of an existing Azure Dev Spaces Controller with the specified update parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param tags Tags for the Azure Dev Spaces Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String name, Map tags) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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(tags); + ControllerUpdateParameters controllerUpdateParameters = new ControllerUpdateParameters(); + controllerUpdateParameters.withTags(tags); + return service.update(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), this.client.acceptLanguage(), controllerUpdateParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and subscription. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<ControllerInner> 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(); + } + }; + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and subscription. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @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); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and subscription. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ControllerInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and subscription. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ControllerInner> 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)); + } + }); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and subscription. + * + ServiceResponse> * @param resourceGroupName Resource group to which the resource belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ControllerInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<ControllerInner> 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 the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the 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); + } + + /** + * Lists the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ControllerInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ControllerInner> 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 the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ControllerInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists connection details for an Azure Dev Spaces Controller. + * Lists connection details for the underlying container resources of an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ControllerConnectionDetailsListInner object if successful. + */ + public ControllerConnectionDetailsListInner listConnectionDetails(String resourceGroupName, String name) { + return listConnectionDetailsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); + } + + /** + * Lists connection details for an Azure Dev Spaces Controller. + * Lists connection details for the underlying container resources of an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the 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 listConnectionDetailsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listConnectionDetailsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Lists connection details for an Azure Dev Spaces Controller. + * Lists connection details for the underlying container resources of an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerConnectionDetailsListInner object + */ + public Observable listConnectionDetailsAsync(String resourceGroupName, String name) { + return listConnectionDetailsWithServiceResponseAsync(resourceGroupName, name).map(new Func1, ControllerConnectionDetailsListInner>() { + @Override + public ControllerConnectionDetailsListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists connection details for an Azure Dev Spaces Controller. + * Lists connection details for the underlying container resources of an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerConnectionDetailsListInner object + */ + public Observable> listConnectionDetailsWithServiceResponseAsync(String resourceGroupName, 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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.listConnectionDetails(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listConnectionDetailsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listConnectionDetailsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<ControllerInner> 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(); + } + }; + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and 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> 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); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and 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<ControllerInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and 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<ControllerInner> 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)); + } + }); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and 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<ControllerInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<ControllerInner> 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 the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the 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); + } + + /** + * Lists the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the 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<ControllerInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the 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<ControllerInner> 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 the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the 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<ControllerInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/DevSpacesManagementClientImpl.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/DevSpacesManagementClientImpl.java new file mode 100644 index 000000000000..e4d0a4053c7c --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/DevSpacesManagementClientImpl.java @@ -0,0 +1,224 @@ +/** + * 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.devspaces.v2019_01_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the DevSpacesManagementClientImpl class. + */ +public class DevSpacesManagementClientImpl 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; + } + + /** Azure subscription ID. */ + private String subscriptionId; + + /** + * Gets Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public DevSpacesManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** 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 DevSpacesManagementClientImpl 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 DevSpacesManagementClientImpl 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 DevSpacesManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ContainerHostMappingsInner object to access its operations. + */ + private ContainerHostMappingsInner containerHostMappings; + + /** + * Gets the ContainerHostMappingsInner object to access its operations. + * @return the ContainerHostMappingsInner object. + */ + public ContainerHostMappingsInner containerHostMappings() { + return this.containerHostMappings; + } + + /** + * 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 ControllersInner object to access its operations. + */ + private ControllersInner controllers; + + /** + * Gets the ControllersInner object to access its operations. + * @return the ControllersInner object. + */ + public ControllersInner controllers() { + return this.controllers; + } + + /** + * Initializes an instance of DevSpacesManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public DevSpacesManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DevSpacesManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DevSpacesManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of DevSpacesManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public DevSpacesManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2019-01-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.containerHostMappings = new ContainerHostMappingsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.controllers = new ControllersInner(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(), "DevSpacesManagementClient", "2019-01-01-preview"); + } +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/DevSpacesManager.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/DevSpacesManager.java new file mode 100644 index 000000000000..947d4698881c --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/DevSpacesManager.java @@ -0,0 +1,123 @@ +/** + * 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.devspaces.v2019_01_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.devspaces.v2019_01_01_preview.ContainerHostMappings; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.Operations; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.Controllers; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DevSpaces resource management. + */ +public final class DevSpacesManager extends ManagerCore { + private ContainerHostMappings containerHostMappings; + private Operations operations; + private Controllers controllers; + /** + * Get a Configurable instance that can be used to create DevSpacesManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DevSpacesManager.ConfigurableImpl(); + } + /** + * Creates an instance of DevSpacesManager that exposes DevSpaces resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DevSpacesManager + */ + public static DevSpacesManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DevSpacesManager(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 DevSpacesManager that exposes DevSpaces resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DevSpacesManager + */ + public static DevSpacesManager authenticate(RestClient restClient, String subscriptionId) { + return new DevSpacesManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DevSpacesManager that exposes DevSpaces management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DevSpaces management API entry points that work across subscriptions + */ + DevSpacesManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ContainerHostMappings. + */ + public ContainerHostMappings containerHostMappings() { + if (this.containerHostMappings == null) { + this.containerHostMappings = new ContainerHostMappingsImpl(this); + } + return this.containerHostMappings; + } + + /** + * @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 Controllers. + */ + public Controllers controllers() { + if (this.controllers == null) { + this.controllers = new ControllersImpl(this); + } + return this.controllers; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DevSpacesManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DevSpacesManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DevSpacesManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new DevSpacesManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/IdParsingUtils.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..33e919db94b3 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_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.devspaces.v2019_01_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/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/OperationsImpl.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/OperationsImpl.java new file mode 100644 index 000000000000..cdd6c660fcec --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_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.devspaces.v2019_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.ResourceProviderOperationDefinition; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DevSpacesManager manager; + + OperationsImpl(DevSpacesManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DevSpacesManager 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 ResourceProviderOperationDefinition call(ResourceProviderOperationDefinitionInner inner) { + return new ResourceProviderOperationDefinitionImpl(inner, manager()); + } + }); + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/OperationsInner.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/OperationsInner.java new file mode 100644 index 000000000000..83c49b002e1e --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/OperationsInner.java @@ -0,0 +1,293 @@ +/** + * 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.devspaces.v2019_01_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 DevSpacesManagementClientImpl 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, DevSpacesManagementClientImpl 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.devspaces.v2019_01_01_preview.Operations list" }) + @GET("providers/Microsoft.DevSpaces/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.devspaces.v2019_01_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @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<ResourceProviderOperationDefinitionInner> 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 operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @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 operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceProviderOperationDefinitionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceProviderOperationDefinitionInner> 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 operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceProviderOperationDefinitionInner> 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 operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @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<ResourceProviderOperationDefinitionInner> 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 operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @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 operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @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<ResourceProviderOperationDefinitionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @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<ResourceProviderOperationDefinitionInner> 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 operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceProviderOperationDefinitionInner> 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/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/PageImpl.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/PageImpl.java new file mode 100644 index 000000000000..c93159c97463 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_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.devspaces.v2019_01_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/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ResourceProviderOperationDefinitionImpl.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ResourceProviderOperationDefinitionImpl.java new file mode 100644 index 000000000000..289352bba1a5 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ResourceProviderOperationDefinitionImpl.java @@ -0,0 +1,37 @@ +/** + * 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.devspaces.v2019_01_01_preview.implementation; + +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.ResourceProviderOperationDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.ResourceProviderOperationDisplay; + +class ResourceProviderOperationDefinitionImpl extends WrapperImpl implements ResourceProviderOperationDefinition { + private final DevSpacesManager manager; + ResourceProviderOperationDefinitionImpl(ResourceProviderOperationDefinitionInner inner, DevSpacesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevSpacesManager manager() { + return this.manager; + } + + @Override + public ResourceProviderOperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ResourceProviderOperationDefinitionInner.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ResourceProviderOperationDefinitionInner.java new file mode 100644 index 000000000000..28c6db2e645f --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/ResourceProviderOperationDefinitionInner.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.devspaces.v2019_01_01_preview.implementation; + +import com.microsoft.azure.management.devspaces.v2019_01_01_preview.ResourceProviderOperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ResourceProviderOperationDefinitionInner model. + */ +public class ResourceProviderOperationDefinitionInner { + /** + * Resource provider operation name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display property. + */ + @JsonProperty(value = "display") + private ResourceProviderOperationDisplay display; + + /** + * Get resource provider operation name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource provider operation name. + * + * @param name the name value to set + * @return the ResourceProviderOperationDefinitionInner object itself. + */ + public ResourceProviderOperationDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display value. + * + * @return the display value + */ + public ResourceProviderOperationDisplay display() { + return this.display; + } + + /** + * Set the display value. + * + * @param display the display value to set + * @return the ResourceProviderOperationDefinitionInner object itself. + */ + public ResourceProviderOperationDefinitionInner withDisplay(ResourceProviderOperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/package-info.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/implementation/package-info.java new file mode 100644 index 000000000000..91c2ea7419dd --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_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 DevSpacesManagementClient. + * Dev Spaces Client. + */ +package com.microsoft.azure.management.devspaces.v2019_01_01_preview.implementation; diff --git a/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/package-info.java b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_01_preview/package-info.java new file mode 100644 index 000000000000..c22bbbfb2677 --- /dev/null +++ b/devspaces/resource-manager/v2019_01_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2019_01_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 DevSpacesManagementClient. + * Dev Spaces Client. + */ +package com.microsoft.azure.management.devspaces.v2019_01_01_preview; diff --git a/devspaces/resource-manager/v2019_04_01/pom.xml b/devspaces/resource-manager/v2019_04_01/pom.xml new file mode 100644 index 000000000000..ac10c586d1ba --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.devspaces.v2019_04_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-devspaces + 1.0.0-beta + jar + Microsoft Azure SDK for DevSpaces Management + This package contains Microsoft DevSpaces 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 + + + + + + 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/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ContainerHostMapping.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ContainerHostMapping.java new file mode 100644 index 000000000000..615bf2bbdd2f --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ContainerHostMapping.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.devspaces.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.devspaces.v2019_04_01.implementation.DevSpacesManager; +import com.microsoft.azure.management.devspaces.v2019_04_01.implementation.ContainerHostMappingInner; + +/** + * Type representing ContainerHostMapping. + */ +public interface ContainerHostMapping extends HasInner, HasManager { + /** + * @return the containerHostResourceId value. + */ + String containerHostResourceId(); + + /** + * @return the mappedControllerResourceId value. + */ + String mappedControllerResourceId(); + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ContainerHostMappings.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ContainerHostMappings.java new file mode 100644 index 000000000000..9810d433ec24 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ContainerHostMappings.java @@ -0,0 +1,29 @@ +/** + * 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.devspaces.v2019_04_01; + +import rx.Observable; +import com.microsoft.azure.management.devspaces.v2019_04_01.implementation.ContainerHostMappingsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerHostMappings. + */ +public interface ContainerHostMappings extends HasInner { + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getContainerHostMappingAsync(String resourceGroupName, String location); + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/Controller.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/Controller.java new file mode 100644 index 000000000000..40721e51ec20 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/Controller.java @@ -0,0 +1,146 @@ +/** + * 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.devspaces.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +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.devspaces.v2019_04_01.implementation.DevSpacesManager; +import com.microsoft.azure.management.devspaces.v2019_04_01.implementation.ControllerInner; + +/** + * Type representing Controller. + */ +public interface Controller extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dataPlaneFqdn value. + */ + String dataPlaneFqdn(); + + /** + * @return the hostSuffix value. + */ + String hostSuffix(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the targetContainerHostCredentialsBase64 value. + */ + String targetContainerHostCredentialsBase64(); + + /** + * @return the targetContainerHostResourceId value. + */ + String targetContainerHostResourceId(); + + /** + * The entirety of the Controller definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithSku, DefinitionStages.WithTargetContainerHostCredentialsBase64, DefinitionStages.WithTargetContainerHostResourceId, DefinitionStages.WithCreate { + } + + /** + * Grouping of Controller definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Controller definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Controller definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the controller definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku the sku parameter value + * @return the next definition stage +*/ + WithTargetContainerHostCredentialsBase64 withSku(Sku sku); + } + + /** + * The stage of the controller definition allowing to specify TargetContainerHostCredentialsBase64. + */ + interface WithTargetContainerHostCredentialsBase64 { + /** + * Specifies targetContainerHostCredentialsBase64. + * @param targetContainerHostCredentialsBase64 Credentials of the target container host (base64) + * @return the next definition stage +*/ + WithTargetContainerHostResourceId withTargetContainerHostCredentialsBase64(String targetContainerHostCredentialsBase64); + } + + /** + * The stage of the controller definition allowing to specify TargetContainerHostResourceId. + */ + interface WithTargetContainerHostResourceId { + /** + * Specifies targetContainerHostResourceId. + * @param targetContainerHostResourceId Resource ID of the target container host + * @return the next definition stage +*/ + WithCreate withTargetContainerHostResourceId(String targetContainerHostResourceId); + } + + /** + * 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, Resource.DefinitionWithTags { + } + } + /** + * The template for a Controller update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithTargetContainerHostCredentialsBase64 { + } + + /** + * Grouping of Controller update stages. + */ + interface UpdateStages { + /** + * The stage of the controller update allowing to specify TargetContainerHostCredentialsBase64. + */ + interface WithTargetContainerHostCredentialsBase64 { + /** + * Specifies targetContainerHostCredentialsBase64. + * @param targetContainerHostCredentialsBase64 Credentials of the target container host (base64) + * @return the next update stage + */ + Update withTargetContainerHostCredentialsBase64(String targetContainerHostCredentialsBase64); + } + + } +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ControllerConnectionDetails.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ControllerConnectionDetails.java new file mode 100644 index 000000000000..07b11b3fdee7 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ControllerConnectionDetails.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.devspaces.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ControllerConnectionDetails model. + */ +public class ControllerConnectionDetails { + /** + * The orchestratorSpecificConnectionDetails property. + */ + @JsonProperty(value = "orchestratorSpecificConnectionDetails") + private OrchestratorSpecificConnectionDetails orchestratorSpecificConnectionDetails; + + /** + * Get the orchestratorSpecificConnectionDetails value. + * + * @return the orchestratorSpecificConnectionDetails value + */ + public OrchestratorSpecificConnectionDetails orchestratorSpecificConnectionDetails() { + return this.orchestratorSpecificConnectionDetails; + } + + /** + * Set the orchestratorSpecificConnectionDetails value. + * + * @param orchestratorSpecificConnectionDetails the orchestratorSpecificConnectionDetails value to set + * @return the ControllerConnectionDetails object itself. + */ + public ControllerConnectionDetails withOrchestratorSpecificConnectionDetails(OrchestratorSpecificConnectionDetails orchestratorSpecificConnectionDetails) { + this.orchestratorSpecificConnectionDetails = orchestratorSpecificConnectionDetails; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ControllerConnectionDetailsList.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ControllerConnectionDetailsList.java new file mode 100644 index 000000000000..991f607a7012 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ControllerConnectionDetailsList.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.devspaces.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.devspaces.v2019_04_01.implementation.DevSpacesManager; +import com.microsoft.azure.management.devspaces.v2019_04_01.implementation.ControllerConnectionDetailsListInner; +import java.util.List; + +/** + * Type representing ControllerConnectionDetailsList. + */ +public interface ControllerConnectionDetailsList extends HasInner, HasManager { + /** + * @return the connectionDetailsList value. + */ + List connectionDetailsList(); + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ControllerUpdateParameters.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ControllerUpdateParameters.java new file mode 100644 index 000000000000..79b6a5b6e452 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ControllerUpdateParameters.java @@ -0,0 +1,72 @@ +/** + * 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.devspaces.v2019_04_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters for updating an Azure Dev Spaces Controller. + */ +@JsonFlatten +public class ControllerUpdateParameters { + /** + * Tags for the Azure Dev Spaces Controller. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Credentials of the target container host (base64). + */ + @JsonProperty(value = "properties.targetContainerHostCredentialsBase64") + private String targetContainerHostCredentialsBase64; + + /** + * Get tags for the Azure Dev Spaces Controller. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set tags for the Azure Dev Spaces Controller. + * + * @param tags the tags value to set + * @return the ControllerUpdateParameters object itself. + */ + public ControllerUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get credentials of the target container host (base64). + * + * @return the targetContainerHostCredentialsBase64 value + */ + public String targetContainerHostCredentialsBase64() { + return this.targetContainerHostCredentialsBase64; + } + + /** + * Set credentials of the target container host (base64). + * + * @param targetContainerHostCredentialsBase64 the targetContainerHostCredentialsBase64 value to set + * @return the ControllerUpdateParameters object itself. + */ + public ControllerUpdateParameters withTargetContainerHostCredentialsBase64(String targetContainerHostCredentialsBase64) { + this.targetContainerHostCredentialsBase64 = targetContainerHostCredentialsBase64; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/Controllers.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/Controllers.java new file mode 100644 index 000000000000..b55c02d0d214 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/Controllers.java @@ -0,0 +1,37 @@ +/** + * 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.devspaces.v2019_04_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.devspaces.v2019_04_01.implementation.ControllersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Controllers. + */ +public interface Controllers extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Lists connection details for an Azure Dev Spaces Controller. + * Lists connection details for the underlying container resources of an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param targetContainerHostResourceId Resource ID of the target container host mapped to the Azure Dev Spaces Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listConnectionDetailsAsync(String resourceGroupName, String name, String targetContainerHostResourceId); + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/DevSpacesErrorResponse.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/DevSpacesErrorResponse.java new file mode 100644 index 000000000000..01038a31367b --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/DevSpacesErrorResponse.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.devspaces.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response indicates that the service is not able to process the + * incoming request. The reason is provided in the error message. + */ +public class DevSpacesErrorResponse { + /** + * The details of the error. + */ + @JsonProperty(value = "error") + private ErrorDetails error; + + /** + * Get the details of the error. + * + * @return the error value + */ + public ErrorDetails error() { + return this.error; + } + + /** + * Set the details of the error. + * + * @param error the error value to set + * @return the DevSpacesErrorResponse object itself. + */ + public DevSpacesErrorResponse withError(ErrorDetails error) { + this.error = error; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/DevSpacesErrorResponseException.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/DevSpacesErrorResponseException.java new file mode 100644 index 000000000000..0e3ecc73832c --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/DevSpacesErrorResponseException.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.devspaces.v2019_04_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with DevSpacesErrorResponse + * information. + */ +public class DevSpacesErrorResponseException extends RestException { + /** + * Initializes a new instance of the DevSpacesErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public DevSpacesErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the DevSpacesErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public DevSpacesErrorResponseException(final String message, final Response response, final DevSpacesErrorResponse body) { + super(message, response, body); + } + + @Override + public DevSpacesErrorResponse body() { + return (DevSpacesErrorResponse) super.body(); + } +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ErrorDetails.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ErrorDetails.java new file mode 100644 index 000000000000..d028a1fafe72 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ErrorDetails.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.devspaces.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ErrorDetails model. + */ +public class ErrorDetails { + /** + * Status code for the error. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Error message describing the error in detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The target of the particular error. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * Get status code for the error. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get error message describing the error in detail. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the target of the particular error. + * + * @return the target value + */ + public String target() { + return this.target; + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/KubernetesConnectionDetails.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/KubernetesConnectionDetails.java new file mode 100644 index 000000000000..288b8e7be1bf --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/KubernetesConnectionDetails.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.devspaces.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Contains information used to connect to a Kubernetes cluster. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("Kubernetes") +public class KubernetesConnectionDetails extends OrchestratorSpecificConnectionDetails { + /** + * Gets the kubeconfig for the cluster. + */ + @JsonProperty(value = "kubeConfig") + private String kubeConfig; + + /** + * Get gets the kubeconfig for the cluster. + * + * @return the kubeConfig value + */ + public String kubeConfig() { + return this.kubeConfig; + } + + /** + * Set gets the kubeconfig for the cluster. + * + * @param kubeConfig the kubeConfig value to set + * @return the KubernetesConnectionDetails object itself. + */ + public KubernetesConnectionDetails withKubeConfig(String kubeConfig) { + this.kubeConfig = kubeConfig; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ListConnectionDetailsParameters.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ListConnectionDetailsParameters.java new file mode 100644 index 000000000000..21bc4ad67320 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ListConnectionDetailsParameters.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.devspaces.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for listing connection details of an Azure Dev Spaces Controller. + */ +public class ListConnectionDetailsParameters { + /** + * Resource ID of the target container host mapped to the Azure Dev Spaces + * Controller. + */ + @JsonProperty(value = "targetContainerHostResourceId", required = true) + private String targetContainerHostResourceId; + + /** + * Get resource ID of the target container host mapped to the Azure Dev Spaces Controller. + * + * @return the targetContainerHostResourceId value + */ + public String targetContainerHostResourceId() { + return this.targetContainerHostResourceId; + } + + /** + * Set resource ID of the target container host mapped to the Azure Dev Spaces Controller. + * + * @param targetContainerHostResourceId the targetContainerHostResourceId value to set + * @return the ListConnectionDetailsParameters object itself. + */ + public ListConnectionDetailsParameters withTargetContainerHostResourceId(String targetContainerHostResourceId) { + this.targetContainerHostResourceId = targetContainerHostResourceId; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/Operations.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/Operations.java new file mode 100644 index 000000000000..7639a7b600e6 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/Operations.java @@ -0,0 +1,28 @@ +/** + * 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.devspaces.v2019_04_01; + +import rx.Observable; +import com.microsoft.azure.management.devspaces.v2019_04_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/OrchestratorSpecificConnectionDetails.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/OrchestratorSpecificConnectionDetails.java new file mode 100644 index 000000000000..ee499c5e178f --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/OrchestratorSpecificConnectionDetails.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.devspaces.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for types that supply values used to connect to container + * orchestrators. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("OrchestratorSpecificConnectionDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Kubernetes", value = KubernetesConnectionDetails.class) +}) +public class OrchestratorSpecificConnectionDetails { +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ProvisioningState.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ProvisioningState.java new file mode 100644 index 000000000000..a8a3efea2c3f --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ProvisioningState.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.devspaces.v2019_04_01; + +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 Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** + * 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/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ResourceProviderOperationDefinition.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ResourceProviderOperationDefinition.java new file mode 100644 index 000000000000..d2b6aaedf041 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ResourceProviderOperationDefinition.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.devspaces.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.devspaces.v2019_04_01.implementation.DevSpacesManager; +import com.microsoft.azure.management.devspaces.v2019_04_01.implementation.ResourceProviderOperationDefinitionInner; + +/** + * Type representing ResourceProviderOperationDefinition. + */ +public interface ResourceProviderOperationDefinition extends HasInner, HasManager { + /** + * @return the display value. + */ + ResourceProviderOperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ResourceProviderOperationDisplay.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ResourceProviderOperationDisplay.java new file mode 100644 index 000000000000..e7fc239e17c2 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/ResourceProviderOperationDisplay.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.devspaces.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ResourceProviderOperationDisplay model. + */ +public class ResourceProviderOperationDisplay { + /** + * Name of the resource provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Name of the resource type. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Name of the resource provider operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the resource provider operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get name of the resource provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set name of the resource provider. + * + * @param provider the provider value to set + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get name of the resource type. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set name of the resource type. + * + * @param resource the resource value to set + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get name of the resource provider operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set name of the resource provider operation. + * + * @param operation the operation value to set + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the resource provider operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the resource provider operation. + * + * @param description the description value to set + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/Sku.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/Sku.java new file mode 100644 index 000000000000..802206714b87 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/Sku.java @@ -0,0 +1,77 @@ +/** + * 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.devspaces.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Model representing SKU for Azure Dev Spaces Controller. + */ +public class Sku { + /** + * The name of the SKU for Azure Dev Spaces Controller. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The tier of the SKU for Azure Dev Spaces Controller. Possible values + * include: 'Standard'. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /** + * Creates an instance of Sku class. + */ + public Sku() { + name = "S1"; + } + + /** + * Get the name of the SKU for Azure Dev Spaces Controller. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU for Azure Dev Spaces Controller. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier of the SKU for Azure Dev Spaces Controller. Possible values include: 'Standard'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set the tier of the SKU for Azure Dev Spaces Controller. Possible values include: 'Standard'. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/SkuTier.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/SkuTier.java new file mode 100644 index 000000000000..dc6dae64e80e --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/SkuTier.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.devspaces.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuTier. + */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Standard for SkuTier. */ + public static final SkuTier STANDARD = fromString("Standard"); + + /** + * Creates or finds a SkuTier from its string representation. + * @param name a name to look for + * @return the corresponding SkuTier + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** + * @return known SkuTier values + */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ContainerHostMappingImpl.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ContainerHostMappingImpl.java new file mode 100644 index 000000000000..29db6a3d858c --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ContainerHostMappingImpl.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.devspaces.v2019_04_01.implementation; + +import com.microsoft.azure.management.devspaces.v2019_04_01.ContainerHostMapping; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ContainerHostMappingImpl extends WrapperImpl implements ContainerHostMapping { + private final DevSpacesManager manager; + ContainerHostMappingImpl(ContainerHostMappingInner inner, DevSpacesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevSpacesManager manager() { + return this.manager; + } + + @Override + public String containerHostResourceId() { + return this.inner().containerHostResourceId(); + } + + @Override + public String mappedControllerResourceId() { + return this.inner().mappedControllerResourceId(); + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ContainerHostMappingInner.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ContainerHostMappingInner.java new file mode 100644 index 000000000000..cc2cfaddf36b --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ContainerHostMappingInner.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.devspaces.v2019_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Container host mapping object specifying the Container host resource ID and + * its associated Controller resource. + */ +public class ContainerHostMappingInner { + /** + * ARM ID of the Container Host resource. + */ + @JsonProperty(value = "containerHostResourceId") + private String containerHostResourceId; + + /** + * ARM ID of the mapped Controller resource. + */ + @JsonProperty(value = "mappedControllerResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String mappedControllerResourceId; + + /** + * Get aRM ID of the Container Host resource. + * + * @return the containerHostResourceId value + */ + public String containerHostResourceId() { + return this.containerHostResourceId; + } + + /** + * Set aRM ID of the Container Host resource. + * + * @param containerHostResourceId the containerHostResourceId value to set + * @return the ContainerHostMappingInner object itself. + */ + public ContainerHostMappingInner withContainerHostResourceId(String containerHostResourceId) { + this.containerHostResourceId = containerHostResourceId; + return this; + } + + /** + * Get aRM ID of the mapped Controller resource. + * + * @return the mappedControllerResourceId value + */ + public String mappedControllerResourceId() { + return this.mappedControllerResourceId; + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ContainerHostMappingsImpl.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ContainerHostMappingsImpl.java new file mode 100644 index 000000000000..a084698911b0 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ContainerHostMappingsImpl.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.devspaces.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.devspaces.v2019_04_01.ContainerHostMappings; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.devspaces.v2019_04_01.ContainerHostMapping; + +class ContainerHostMappingsImpl extends WrapperImpl implements ContainerHostMappings { + private final DevSpacesManager manager; + + ContainerHostMappingsImpl(DevSpacesManager manager) { + super(manager.inner().containerHostMappings()); + this.manager = manager; + } + + public DevSpacesManager manager() { + return this.manager; + } + + @Override + public Observable getContainerHostMappingAsync(String resourceGroupName, String location) { + ContainerHostMappingsInner client = this.inner(); + return client.getContainerHostMappingAsync(resourceGroupName, location) + .map(new Func1() { + @Override + public ContainerHostMapping call(ContainerHostMappingInner inner) { + return new ContainerHostMappingImpl(inner, manager()); + } + }); + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ContainerHostMappingsInner.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ContainerHostMappingsInner.java new file mode 100644 index 000000000000..ad2f30a68fe8 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ContainerHostMappingsInner.java @@ -0,0 +1,236 @@ +/** + * 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.devspaces.v2019_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.devspaces.v2019_04_01.DevSpacesErrorResponseException; +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.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +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 ContainerHostMappings. + */ +public class ContainerHostMappingsInner { + /** The Retrofit service to perform REST calls. */ + private ContainerHostMappingsService service; + /** The service client containing this operation class. */ + private DevSpacesManagementClientImpl client; + + /** + * Initializes an instance of ContainerHostMappingsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerHostMappingsInner(Retrofit retrofit, DevSpacesManagementClientImpl client) { + this.service = retrofit.create(ContainerHostMappingsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerHostMappings to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerHostMappingsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.devspaces.v2019_04_01.ContainerHostMappings getContainerHostMapping" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/locations/{location}/checkContainerHostMapping") + Observable> getContainerHostMapping(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ContainerHostMappingInner containerHostMapping, @Header("User-Agent") String userAgent); + + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DevSpacesErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerHostMappingInner object if successful. + */ + public ContainerHostMappingInner getContainerHostMapping(String resourceGroupName, String location) { + return getContainerHostMappingWithServiceResponseAsync(resourceGroupName, location).toBlocking().single().body(); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @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 getContainerHostMappingAsync(String resourceGroupName, String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getContainerHostMappingWithServiceResponseAsync(resourceGroupName, location), serviceCallback); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerHostMappingInner object + */ + public Observable getContainerHostMappingAsync(String resourceGroupName, String location) { + return getContainerHostMappingWithServiceResponseAsync(resourceGroupName, location).map(new Func1, ContainerHostMappingInner>() { + @Override + public ContainerHostMappingInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerHostMappingInner object + */ + public Observable> getContainerHostMappingWithServiceResponseAsync(String resourceGroupName, String location) { + 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 (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."); + } + final String containerHostResourceId = null; + ContainerHostMappingInner containerHostMapping = new ContainerHostMappingInner(); + containerHostMapping.withContainerHostResourceId(null); + return service.getContainerHostMapping(this.client.subscriptionId(), resourceGroupName, location, this.client.apiVersion(), this.client.acceptLanguage(), containerHostMapping, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getContainerHostMappingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @param containerHostResourceId ARM ID of the Container Host resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DevSpacesErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerHostMappingInner object if successful. + */ + public ContainerHostMappingInner getContainerHostMapping(String resourceGroupName, String location, String containerHostResourceId) { + return getContainerHostMappingWithServiceResponseAsync(resourceGroupName, location, containerHostResourceId).toBlocking().single().body(); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @param containerHostResourceId ARM ID of the Container Host 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 getContainerHostMappingAsync(String resourceGroupName, String location, String containerHostResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getContainerHostMappingWithServiceResponseAsync(resourceGroupName, location, containerHostResourceId), serviceCallback); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @param containerHostResourceId ARM ID of the Container Host resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerHostMappingInner object + */ + public Observable getContainerHostMappingAsync(String resourceGroupName, String location, String containerHostResourceId) { + return getContainerHostMappingWithServiceResponseAsync(resourceGroupName, location, containerHostResourceId).map(new Func1, ContainerHostMappingInner>() { + @Override + public ContainerHostMappingInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns container host mapping object for a container host resource ID if an associated controller exists. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @param containerHostResourceId ARM ID of the Container Host resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerHostMappingInner object + */ + public Observable> getContainerHostMappingWithServiceResponseAsync(String resourceGroupName, String location, String containerHostResourceId) { + 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 (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."); + } + ContainerHostMappingInner containerHostMapping = new ContainerHostMappingInner(); + containerHostMapping.withContainerHostResourceId(containerHostResourceId); + return service.getContainerHostMapping(this.client.subscriptionId(), resourceGroupName, location, this.client.apiVersion(), this.client.acceptLanguage(), containerHostMapping, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getContainerHostMappingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getContainerHostMappingDelegate(Response response) throws DevSpacesErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(DevSpacesErrorResponseException.class) + .build(response); + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllerConnectionDetailsListImpl.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllerConnectionDetailsListImpl.java new file mode 100644 index 000000000000..96ec3647adf8 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllerConnectionDetailsListImpl.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.devspaces.v2019_04_01.implementation; + +import com.microsoft.azure.management.devspaces.v2019_04_01.ControllerConnectionDetailsList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.devspaces.v2019_04_01.ControllerConnectionDetails; + +class ControllerConnectionDetailsListImpl extends WrapperImpl implements ControllerConnectionDetailsList { + private final DevSpacesManager manager; + ControllerConnectionDetailsListImpl(ControllerConnectionDetailsListInner inner, DevSpacesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevSpacesManager manager() { + return this.manager; + } + + @Override + public List connectionDetailsList() { + return this.inner().connectionDetailsList(); + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllerConnectionDetailsListInner.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllerConnectionDetailsListInner.java new file mode 100644 index 000000000000..a3767bcab637 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllerConnectionDetailsListInner.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.devspaces.v2019_04_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.devspaces.v2019_04_01.ControllerConnectionDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ControllerConnectionDetailsListInner model. + */ +public class ControllerConnectionDetailsListInner { + /** + * List of Azure Dev Spaces Controller connection details. + */ + @JsonProperty(value = "connectionDetailsList") + private List connectionDetailsList; + + /** + * Get list of Azure Dev Spaces Controller connection details. + * + * @return the connectionDetailsList value + */ + public List connectionDetailsList() { + return this.connectionDetailsList; + } + + /** + * Set list of Azure Dev Spaces Controller connection details. + * + * @param connectionDetailsList the connectionDetailsList value to set + * @return the ControllerConnectionDetailsListInner object itself. + */ + public ControllerConnectionDetailsListInner withConnectionDetailsList(List connectionDetailsList) { + this.connectionDetailsList = connectionDetailsList; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllerImpl.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllerImpl.java new file mode 100644 index 000000000000..8cce65680497 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllerImpl.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.devspaces.v2019_04_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.devspaces.v2019_04_01.Controller; +import rx.Observable; +import com.microsoft.azure.management.devspaces.v2019_04_01.ControllerUpdateParameters; +import com.microsoft.azure.management.devspaces.v2019_04_01.ProvisioningState; +import com.microsoft.azure.management.devspaces.v2019_04_01.Sku; +import rx.functions.Func1; + +class ControllerImpl extends GroupableResourceCoreImpl implements Controller, Controller.Definition, Controller.Update { + private ControllerUpdateParameters updateParameter; + ControllerImpl(String name, ControllerInner inner, DevSpacesManager manager) { + super(name, inner, manager); + this.updateParameter = new ControllerUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + ControllersInner client = this.manager().inner().controllers(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public ControllerInner call(ControllerInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ControllersInner client = this.manager().inner().controllers(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public ControllerInner call(ControllerInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ControllersInner client = this.manager().inner().controllers(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new ControllerUpdateParameters(); + } + + @Override + public String dataPlaneFqdn() { + return this.inner().dataPlaneFqdn(); + } + + @Override + public String hostSuffix() { + return this.inner().hostSuffix(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public String targetContainerHostCredentialsBase64() { + return this.inner().targetContainerHostCredentialsBase64(); + } + + @Override + public String targetContainerHostResourceId() { + return this.inner().targetContainerHostResourceId(); + } + + @Override + public ControllerImpl withSku(Sku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public ControllerImpl withTargetContainerHostResourceId(String targetContainerHostResourceId) { + this.inner().withTargetContainerHostResourceId(targetContainerHostResourceId); + return this; + } + + @Override + public ControllerImpl withTargetContainerHostCredentialsBase64(String targetContainerHostCredentialsBase64) { + if (isInCreateMode()) { + this.inner().withTargetContainerHostCredentialsBase64(targetContainerHostCredentialsBase64); + } else { + this.updateParameter.withTargetContainerHostCredentialsBase64(targetContainerHostCredentialsBase64); + } + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllerInner.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllerInner.java new file mode 100644 index 000000000000..17fb993c620b --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllerInner.java @@ -0,0 +1,150 @@ +/** + * 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.devspaces.v2019_04_01.implementation; + +import com.microsoft.azure.management.devspaces.v2019_04_01.ProvisioningState; +import com.microsoft.azure.management.devspaces.v2019_04_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The ControllerInner model. + */ +@JsonFlatten +@SkipParentValidation +public class ControllerInner extends Resource { + /** + * Provisioning state of the Azure Dev Spaces Controller. Possible values + * include: 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating', + * 'Deleting', 'Deleted'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * DNS suffix for public endpoints running in the Azure Dev Spaces + * Controller. + */ + @JsonProperty(value = "properties.hostSuffix", access = JsonProperty.Access.WRITE_ONLY) + private String hostSuffix; + + /** + * DNS name for accessing DataPlane services. + */ + @JsonProperty(value = "properties.dataPlaneFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String dataPlaneFqdn; + + /** + * Resource ID of the target container host. + */ + @JsonProperty(value = "properties.targetContainerHostResourceId", required = true) + private String targetContainerHostResourceId; + + /** + * Credentials of the target container host (base64). + */ + @JsonProperty(value = "properties.targetContainerHostCredentialsBase64", required = true) + private String targetContainerHostCredentialsBase64; + + /** + * The sku property. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * Get provisioning state of the Azure Dev Spaces Controller. Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating', 'Deleting', 'Deleted'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get dNS suffix for public endpoints running in the Azure Dev Spaces Controller. + * + * @return the hostSuffix value + */ + public String hostSuffix() { + return this.hostSuffix; + } + + /** + * Get dNS name for accessing DataPlane services. + * + * @return the dataPlaneFqdn value + */ + public String dataPlaneFqdn() { + return this.dataPlaneFqdn; + } + + /** + * Get resource ID of the target container host. + * + * @return the targetContainerHostResourceId value + */ + public String targetContainerHostResourceId() { + return this.targetContainerHostResourceId; + } + + /** + * Set resource ID of the target container host. + * + * @param targetContainerHostResourceId the targetContainerHostResourceId value to set + * @return the ControllerInner object itself. + */ + public ControllerInner withTargetContainerHostResourceId(String targetContainerHostResourceId) { + this.targetContainerHostResourceId = targetContainerHostResourceId; + return this; + } + + /** + * Get credentials of the target container host (base64). + * + * @return the targetContainerHostCredentialsBase64 value + */ + public String targetContainerHostCredentialsBase64() { + return this.targetContainerHostCredentialsBase64; + } + + /** + * Set credentials of the target container host (base64). + * + * @param targetContainerHostCredentialsBase64 the targetContainerHostCredentialsBase64 value to set + * @return the ControllerInner object itself. + */ + public ControllerInner withTargetContainerHostCredentialsBase64(String targetContainerHostCredentialsBase64) { + this.targetContainerHostCredentialsBase64 = targetContainerHostCredentialsBase64; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the ControllerInner object itself. + */ + public ControllerInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllersImpl.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllersImpl.java new file mode 100644 index 000000000000..671341eebe4a --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllersImpl.java @@ -0,0 +1,151 @@ +/** + * 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. + * def + */ + +package com.microsoft.azure.management.devspaces.v2019_04_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.devspaces.v2019_04_01.Controllers; +import com.microsoft.azure.management.devspaces.v2019_04_01.Controller; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.devspaces.v2019_04_01.ControllerConnectionDetailsList; + +class ControllersImpl extends GroupableResourcesCoreImpl implements Controllers { + protected ControllersImpl(DevSpacesManager manager) { + super(manager.inner().controllers(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ControllersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ControllersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ControllersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ControllersInner 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 Controller call(ControllerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ControllersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ControllersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Controller call(ControllerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ControllerImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listConnectionDetailsAsync(String resourceGroupName, String name, String targetContainerHostResourceId) { + ControllersInner client = this.inner(); + return client.listConnectionDetailsAsync(resourceGroupName, name, targetContainerHostResourceId) + .map(new Func1() { + @Override + public ControllerConnectionDetailsList call(ControllerConnectionDetailsListInner inner) { + return new ControllerConnectionDetailsListImpl(inner, manager()); + } + }); + } + + @Override + protected ControllerImpl wrapModel(ControllerInner inner) { + return new ControllerImpl(inner.name(), inner, manager()); + } + + @Override + protected ControllerImpl wrapModel(String name) { + return new ControllerImpl(name, new ControllerInner(), this.manager()); + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllersInner.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllersInner.java new file mode 100644 index 000000000000..770784d81257 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ControllersInner.java @@ -0,0 +1,1212 @@ +/** + * 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.devspaces.v2019_04_01.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.ListOperationCallback; +import com.microsoft.azure.management.devspaces.v2019_04_01.ControllerUpdateParameters; +import com.microsoft.azure.management.devspaces.v2019_04_01.DevSpacesErrorResponseException; +import com.microsoft.azure.management.devspaces.v2019_04_01.ListConnectionDetailsParameters; +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 Controllers. + */ +public class ControllersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ControllersService service; + /** The service client containing this operation class. */ + private DevSpacesManagementClientImpl client; + + /** + * Initializes an instance of ControllersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ControllersInner(Retrofit retrofit, DevSpacesManagementClientImpl client) { + this.service = retrofit.create(ControllersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Controllers to be + * used by Retrofit to perform actually REST calls. + */ + interface ControllersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.devspaces.v2019_04_01.Controllers getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @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.devspaces.v2019_04_01.Controllers create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Body ControllerInner controller, @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.devspaces.v2019_04_01.Controllers beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Body ControllerInner controller, @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.devspaces.v2019_04_01.Controllers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @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.devspaces.v2019_04_01.Controllers beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @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.devspaces.v2019_04_01.Controllers update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Body ControllerUpdateParameters controllerUpdateParameters, @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.devspaces.v2019_04_01.Controllers listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers") + 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.devspaces.v2019_04_01.Controllers list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers") + 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.devspaces.v2019_04_01.Controllers listConnectionDetails" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}/listConnectionDetails") + Observable> listConnectionDetails(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ListConnectionDetailsParameters listConnectionDetailsParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.devspaces.v2019_04_01.Controllers listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@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.devspaces.v2019_04_01.Controllers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets an Azure Dev Spaces Controller. + * Gets the properties for an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DevSpacesErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ControllerInner object if successful. + */ + public ControllerInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); + } + + /** + * Gets an Azure Dev Spaces Controller. + * Gets the properties for an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the 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 name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets an Azure Dev Spaces Controller. + * Gets the properties for an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name).map(new Func1, ControllerInner>() { + @Override + public ControllerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an Azure Dev Spaces Controller. + * Gets the properties for an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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, name, 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 DevSpacesErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(DevSpacesErrorResponseException.class) + .build(response); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DevSpacesErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ControllerInner object if successful. + */ + public ControllerInner create(String resourceGroupName, String name, ControllerInner controller) { + return createWithServiceResponseAsync(resourceGroupName, name, controller).toBlocking().last().body(); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @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 createAsync(String resourceGroupName, String name, ControllerInner controller, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, name, controller), serviceCallback); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String name, ControllerInner controller) { + return createWithServiceResponseAsync(resourceGroupName, name, controller).map(new Func1, ControllerInner>() { + @Override + public ControllerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String name, ControllerInner controller) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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 (controller == null) { + throw new IllegalArgumentException("Parameter controller is required and cannot be null."); + } + Validator.validate(controller); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), controller, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DevSpacesErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ControllerInner object if successful. + */ + public ControllerInner beginCreate(String resourceGroupName, String name, ControllerInner controller) { + return beginCreateWithServiceResponseAsync(resourceGroupName, name, controller).toBlocking().single().body(); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @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 beginCreateAsync(String resourceGroupName, String name, ControllerInner controller, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, name, controller), serviceCallback); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String name, ControllerInner controller) { + return beginCreateWithServiceResponseAsync(resourceGroupName, name, controller).map(new Func1, ControllerInner>() { + @Override + public ControllerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an Azure Dev Spaces Controller. + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String name, ControllerInner controller) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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 (controller == null) { + throw new IllegalArgumentException("Parameter controller is required and cannot be null."); + } + Validator.validate(controller); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), controller, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws DevSpacesErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(DevSpacesErrorResponseException.class) + .build(response); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DevSpacesErrorResponseException 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 name) { + deleteWithServiceResponseAsync(resourceGroupName, name).toBlocking().last().body(); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the 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 name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String name) { + return deleteWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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, name, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DevSpacesErrorResponseException 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 name) { + beginDeleteWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the 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 name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String name) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an Azure Dev Spaces Controller. + * Deletes an existing Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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, name, 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 DevSpacesErrorResponseException, 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(DevSpacesErrorResponseException.class) + .build(response); + } + + /** + * Updates an Azure Dev Spaces Controller. + * Updates the properties of an existing Azure Dev Spaces Controller with the specified update parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controllerUpdateParameters Parameters for updating the Azure Dev Spaces Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DevSpacesErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ControllerInner object if successful. + */ + public ControllerInner update(String resourceGroupName, String name, ControllerUpdateParameters controllerUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, name, controllerUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates an Azure Dev Spaces Controller. + * Updates the properties of an existing Azure Dev Spaces Controller with the specified update parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controllerUpdateParameters Parameters for updating the Azure Dev Spaces Controller. + * @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 name, ControllerUpdateParameters controllerUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, name, controllerUpdateParameters), serviceCallback); + } + + /** + * Updates an Azure Dev Spaces Controller. + * Updates the properties of an existing Azure Dev Spaces Controller with the specified update parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controllerUpdateParameters Parameters for updating the Azure Dev Spaces Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerInner object + */ + public Observable updateAsync(String resourceGroupName, String name, ControllerUpdateParameters controllerUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, name, controllerUpdateParameters).map(new Func1, ControllerInner>() { + @Override + public ControllerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an Azure Dev Spaces Controller. + * Updates the properties of an existing Azure Dev Spaces Controller with the specified update parameters. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controllerUpdateParameters Parameters for updating the Azure Dev Spaces Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String name, ControllerUpdateParameters controllerUpdateParameters) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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 (controllerUpdateParameters == null) { + throw new IllegalArgumentException("Parameter controllerUpdateParameters is required and cannot be null."); + } + Validator.validate(controllerUpdateParameters); + return service.update(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), controllerUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws DevSpacesErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(DevSpacesErrorResponseException.class) + .build(response); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and subscription. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DevSpacesErrorResponseException 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<ControllerInner> 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(); + } + }; + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and subscription. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @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); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and subscription. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ControllerInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and subscription. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ControllerInner> 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)); + } + }); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and subscription. + * + ServiceResponse> * @param resourceGroupName Resource group to which the resource belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ControllerInner> 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 DevSpacesErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., DevSpacesErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(DevSpacesErrorResponseException.class) + .build(response); + } + + /** + * Lists the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DevSpacesErrorResponseException 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<ControllerInner> 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 the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the 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); + } + + /** + * Lists the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ControllerInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ControllerInner> 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 the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ControllerInner> 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 DevSpacesErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., DevSpacesErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(DevSpacesErrorResponseException.class) + .build(response); + } + + /** + * Lists connection details for an Azure Dev Spaces Controller. + * Lists connection details for the underlying container resources of an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param targetContainerHostResourceId Resource ID of the target container host mapped to the Azure Dev Spaces Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DevSpacesErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ControllerConnectionDetailsListInner object if successful. + */ + public ControllerConnectionDetailsListInner listConnectionDetails(String resourceGroupName, String name, String targetContainerHostResourceId) { + return listConnectionDetailsWithServiceResponseAsync(resourceGroupName, name, targetContainerHostResourceId).toBlocking().single().body(); + } + + /** + * Lists connection details for an Azure Dev Spaces Controller. + * Lists connection details for the underlying container resources of an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param targetContainerHostResourceId Resource ID of the target container host mapped to the Azure Dev Spaces Controller. + * @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 listConnectionDetailsAsync(String resourceGroupName, String name, String targetContainerHostResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listConnectionDetailsWithServiceResponseAsync(resourceGroupName, name, targetContainerHostResourceId), serviceCallback); + } + + /** + * Lists connection details for an Azure Dev Spaces Controller. + * Lists connection details for the underlying container resources of an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param targetContainerHostResourceId Resource ID of the target container host mapped to the Azure Dev Spaces Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerConnectionDetailsListInner object + */ + public Observable listConnectionDetailsAsync(String resourceGroupName, String name, String targetContainerHostResourceId) { + return listConnectionDetailsWithServiceResponseAsync(resourceGroupName, name, targetContainerHostResourceId).map(new Func1, ControllerConnectionDetailsListInner>() { + @Override + public ControllerConnectionDetailsListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists connection details for an Azure Dev Spaces Controller. + * Lists connection details for the underlying container resources of an Azure Dev Spaces Controller. + * + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param targetContainerHostResourceId Resource ID of the target container host mapped to the Azure Dev Spaces Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ControllerConnectionDetailsListInner object + */ + public Observable> listConnectionDetailsWithServiceResponseAsync(String resourceGroupName, String name, String targetContainerHostResourceId) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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 (targetContainerHostResourceId == null) { + throw new IllegalArgumentException("Parameter targetContainerHostResourceId is required and cannot be null."); + } + ListConnectionDetailsParameters listConnectionDetailsParameters = new ListConnectionDetailsParameters(); + listConnectionDetailsParameters.withTargetContainerHostResourceId(targetContainerHostResourceId); + return service.listConnectionDetails(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), this.client.acceptLanguage(), listConnectionDetailsParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listConnectionDetailsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listConnectionDetailsDelegate(Response response) throws DevSpacesErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(DevSpacesErrorResponseException.class) + .build(response); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DevSpacesErrorResponseException 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<ControllerInner> 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(); + } + }; + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and 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> 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); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and 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<ControllerInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and 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<ControllerInner> 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)); + } + }); + } + + /** + * Lists the Azure Dev Spaces Controllers in a resource group. + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and 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<ControllerInner> 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 DevSpacesErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., DevSpacesErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(DevSpacesErrorResponseException.class) + .build(response); + } + + /** + * Lists the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DevSpacesErrorResponseException 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<ControllerInner> 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 the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the 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); + } + + /** + * Lists the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the 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<ControllerInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the 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<ControllerInner> 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 the Azure Dev Spaces Controllers in a subscription. + * Lists all the Azure Dev Spaces Controllers with their properties in the 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<ControllerInner> 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 DevSpacesErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., DevSpacesErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(DevSpacesErrorResponseException.class) + .build(response); + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/DevSpacesManagementClientImpl.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/DevSpacesManagementClientImpl.java new file mode 100644 index 000000000000..092aab391395 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/DevSpacesManagementClientImpl.java @@ -0,0 +1,224 @@ +/** + * 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.devspaces.v2019_04_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the DevSpacesManagementClientImpl class. + */ +public class DevSpacesManagementClientImpl 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; + } + + /** Azure subscription ID. */ + private String subscriptionId; + + /** + * Gets Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public DevSpacesManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** 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 DevSpacesManagementClientImpl 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 DevSpacesManagementClientImpl 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 DevSpacesManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ContainerHostMappingsInner object to access its operations. + */ + private ContainerHostMappingsInner containerHostMappings; + + /** + * Gets the ContainerHostMappingsInner object to access its operations. + * @return the ContainerHostMappingsInner object. + */ + public ContainerHostMappingsInner containerHostMappings() { + return this.containerHostMappings; + } + + /** + * 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 ControllersInner object to access its operations. + */ + private ControllersInner controllers; + + /** + * Gets the ControllersInner object to access its operations. + * @return the ControllersInner object. + */ + public ControllersInner controllers() { + return this.controllers; + } + + /** + * Initializes an instance of DevSpacesManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public DevSpacesManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DevSpacesManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DevSpacesManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of DevSpacesManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public DevSpacesManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2019-04-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.containerHostMappings = new ContainerHostMappingsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.controllers = new ControllersInner(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(), "DevSpacesManagementClient", "2019-04-01"); + } +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/DevSpacesManager.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/DevSpacesManager.java new file mode 100644 index 000000000000..170c5efc6224 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/DevSpacesManager.java @@ -0,0 +1,123 @@ +/** + * 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.devspaces.v2019_04_01.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.devspaces.v2019_04_01.ContainerHostMappings; +import com.microsoft.azure.management.devspaces.v2019_04_01.Operations; +import com.microsoft.azure.management.devspaces.v2019_04_01.Controllers; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DevSpaces resource management. + */ +public final class DevSpacesManager extends ManagerCore { + private ContainerHostMappings containerHostMappings; + private Operations operations; + private Controllers controllers; + /** + * Get a Configurable instance that can be used to create DevSpacesManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DevSpacesManager.ConfigurableImpl(); + } + /** + * Creates an instance of DevSpacesManager that exposes DevSpaces resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DevSpacesManager + */ + public static DevSpacesManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DevSpacesManager(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 DevSpacesManager that exposes DevSpaces resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DevSpacesManager + */ + public static DevSpacesManager authenticate(RestClient restClient, String subscriptionId) { + return new DevSpacesManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DevSpacesManager that exposes DevSpaces management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DevSpaces management API entry points that work across subscriptions + */ + DevSpacesManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ContainerHostMappings. + */ + public ContainerHostMappings containerHostMappings() { + if (this.containerHostMappings == null) { + this.containerHostMappings = new ContainerHostMappingsImpl(this); + } + return this.containerHostMappings; + } + + /** + * @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 Controllers. + */ + public Controllers controllers() { + if (this.controllers == null) { + this.controllers = new ControllersImpl(this); + } + return this.controllers; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DevSpacesManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DevSpacesManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DevSpacesManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new DevSpacesManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/IdParsingUtils.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..3b44ead9b439 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/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.devspaces.v2019_04_01.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/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/OperationsImpl.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..4795d195f52a --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/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.devspaces.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.devspaces.v2019_04_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.devspaces.v2019_04_01.ResourceProviderOperationDefinition; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DevSpacesManager manager; + + OperationsImpl(DevSpacesManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DevSpacesManager 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 ResourceProviderOperationDefinition call(ResourceProviderOperationDefinitionInner inner) { + return new ResourceProviderOperationDefinitionImpl(inner, manager()); + } + }); + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/OperationsInner.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..34ace9b339ef --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/OperationsInner.java @@ -0,0 +1,293 @@ +/** + * 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.devspaces.v2019_04_01.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 DevSpacesManagementClientImpl 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, DevSpacesManagementClientImpl 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.devspaces.v2019_04_01.Operations list" }) + @GET("providers/Microsoft.DevSpaces/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.devspaces.v2019_04_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @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<ResourceProviderOperationDefinitionInner> 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 operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @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 operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceProviderOperationDefinitionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceProviderOperationDefinitionInner> 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 operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceProviderOperationDefinitionInner> 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 operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @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<ResourceProviderOperationDefinitionInner> 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 operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @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 operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @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<ResourceProviderOperationDefinitionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + * @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<ResourceProviderOperationDefinitionInner> 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 operations for the resource provider. + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceProviderOperationDefinitionInner> 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/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/PageImpl.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/PageImpl.java new file mode 100644 index 000000000000..ae251a441f73 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/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.devspaces.v2019_04_01.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/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ResourceProviderOperationDefinitionImpl.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ResourceProviderOperationDefinitionImpl.java new file mode 100644 index 000000000000..73de54662064 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ResourceProviderOperationDefinitionImpl.java @@ -0,0 +1,37 @@ +/** + * 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.devspaces.v2019_04_01.implementation; + +import com.microsoft.azure.management.devspaces.v2019_04_01.ResourceProviderOperationDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.devspaces.v2019_04_01.ResourceProviderOperationDisplay; + +class ResourceProviderOperationDefinitionImpl extends WrapperImpl implements ResourceProviderOperationDefinition { + private final DevSpacesManager manager; + ResourceProviderOperationDefinitionImpl(ResourceProviderOperationDefinitionInner inner, DevSpacesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevSpacesManager manager() { + return this.manager; + } + + @Override + public ResourceProviderOperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ResourceProviderOperationDefinitionInner.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ResourceProviderOperationDefinitionInner.java new file mode 100644 index 000000000000..dae6cac43136 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/ResourceProviderOperationDefinitionInner.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.devspaces.v2019_04_01.implementation; + +import com.microsoft.azure.management.devspaces.v2019_04_01.ResourceProviderOperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ResourceProviderOperationDefinitionInner model. + */ +public class ResourceProviderOperationDefinitionInner { + /** + * Resource provider operation name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display property. + */ + @JsonProperty(value = "display") + private ResourceProviderOperationDisplay display; + + /** + * Get resource provider operation name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource provider operation name. + * + * @param name the name value to set + * @return the ResourceProviderOperationDefinitionInner object itself. + */ + public ResourceProviderOperationDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display value. + * + * @return the display value + */ + public ResourceProviderOperationDisplay display() { + return this.display; + } + + /** + * Set the display value. + * + * @param display the display value to set + * @return the ResourceProviderOperationDefinitionInner object itself. + */ + public ResourceProviderOperationDefinitionInner withDisplay(ResourceProviderOperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/package-info.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/implementation/package-info.java new file mode 100644 index 000000000000..413d096b0e37 --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/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 DevSpacesManagementClient. + * Dev Spaces Client. + */ +package com.microsoft.azure.management.devspaces.v2019_04_01.implementation; diff --git a/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/package-info.java b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/package-info.java new file mode 100644 index 000000000000..804e77ae33de --- /dev/null +++ b/devspaces/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/devspaces/v2019_04_01/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 DevSpacesManagementClient. + * Dev Spaces Client. + */ +package com.microsoft.azure.management.devspaces.v2019_04_01;