diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/CachedImages.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/CachedImages.java new file mode 100644 index 000000000000..6cc3f3178abd --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/CachedImages.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cached image and OS type. + */ +public class CachedImages { + /** + * The resource Id of the cached image. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The OS type of the cached image. + */ + @JsonProperty(value = "osType", required = true) + private String osType; + + /** + * The cached image name. + */ + @JsonProperty(value = "image", required = true) + private String image; + + /** + * Get the resource Id of the cached image. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource Id of the cached image. + * + * @param id the id value to set + * @return the CachedImages object itself. + */ + public CachedImages withId(String id) { + this.id = id; + return this; + } + + /** + * Get the OS type of the cached image. + * + * @return the osType value + */ + public String osType() { + return this.osType; + } + + /** + * Set the OS type of the cached image. + * + * @param osType the osType value to set + * @return the CachedImages object itself. + */ + public CachedImages withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the cached image name. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set the cached image name. + * + * @param image the image value to set + * @return the CachedImages object itself. + */ + public CachedImages withImage(String image) { + this.image = image; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Capabilities.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Capabilities.java new file mode 100644 index 000000000000..7dc8a9e3e609 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Capabilities.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The regional capabilities. + */ +public class Capabilities { + /** + * The resource type that this capability describes. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * The OS type that this capability describes. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private String osType; + + /** + * The resource location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * The ip address type that this capability describes. + */ + @JsonProperty(value = "ipAddressType", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddressType; + + /** + * The GPU sku that this capability describes. + */ + @JsonProperty(value = "gpu", access = JsonProperty.Access.WRITE_ONLY) + private String gpu; + + /** + * The supported capabilities. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private CapabilitiesCapabilities capabilities; + + /** + * Get the resource type that this capability describes. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the OS type that this capability describes. + * + * @return the osType value + */ + public String osType() { + return this.osType; + } + + /** + * Get the resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Get the ip address type that this capability describes. + * + * @return the ipAddressType value + */ + public String ipAddressType() { + return this.ipAddressType; + } + + /** + * Get the GPU sku that this capability describes. + * + * @return the gpu value + */ + public String gpu() { + return this.gpu; + } + + /** + * Get the supported capabilities. + * + * @return the capabilities value + */ + public CapabilitiesCapabilities capabilities() { + return this.capabilities; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/CapabilitiesCapabilities.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/CapabilitiesCapabilities.java new file mode 100644 index 000000000000..f03f430f6798 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/CapabilitiesCapabilities.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.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The supported capabilities. + */ +public class CapabilitiesCapabilities { + /** + * The maximum allowed memory request in GB. + */ + @JsonProperty(value = "maxMemoryInGB", access = JsonProperty.Access.WRITE_ONLY) + private Double maxMemoryInGB; + + /** + * The maximum allowed CPU request in cores. + */ + @JsonProperty(value = "maxCpu", access = JsonProperty.Access.WRITE_ONLY) + private Double maxCpu; + + /** + * The maximum allowed GPU count. + */ + @JsonProperty(value = "maxGpuCount", access = JsonProperty.Access.WRITE_ONLY) + private Double maxGpuCount; + + /** + * Get the maximum allowed memory request in GB. + * + * @return the maxMemoryInGB value + */ + public Double maxMemoryInGB() { + return this.maxMemoryInGB; + } + + /** + * Get the maximum allowed CPU request in cores. + * + * @return the maxCpu value + */ + public Double maxCpu() { + return this.maxCpu; + } + + /** + * Get the maximum allowed GPU count. + * + * @return the maxGpuCount value + */ + public Double maxGpuCount() { + return this.maxGpuCount; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/CachedImagesListResultInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/CachedImagesListResultInner.java new file mode 100644 index 000000000000..01b63c4a860e --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/CachedImagesListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_10_01.CachedImages; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response containing cached images. + */ +public class CachedImagesListResultInner { + /** + * The list of cached images. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URI to fetch the next page of cached images. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the list of cached images. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of cached images. + * + * @param value the value value to set + * @return the CachedImagesListResultInner object itself. + */ + public CachedImagesListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URI to fetch the next page of cached images. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URI to fetch the next page of cached images. + * + * @param nextLink the nextLink value to set + * @return the CachedImagesListResultInner object itself. + */ + public CachedImagesListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/CapabilitiesListResultInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/CapabilitiesListResultInner.java new file mode 100644 index 000000000000..583ee7663313 --- /dev/null +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/CapabilitiesListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_10_01.Capabilities; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response containing list of capabilities. + */ +public class CapabilitiesListResultInner { + /** + * The list of capabilities. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URI to fetch the next page of capabilities. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the list of capabilities. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of capabilities. + * + * @param value the value value to set + * @return the CapabilitiesListResultInner object itself. + */ + public CapabilitiesListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URI to fetch the next page of capabilities. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URI to fetch the next page of capabilities. + * + * @param nextLink the nextLink value to set + * @return the CapabilitiesListResultInner object itself. + */ + public CapabilitiesListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInstanceManagementClientImpl.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInstanceManagementClientImpl.java index 6a9afa4fab67..95f4d9f234d8 100644 --- a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInstanceManagementClientImpl.java +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInstanceManagementClientImpl.java @@ -8,15 +8,32 @@ package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; +import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CloudException; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; /** * Initializes a new instance of the ContainerInstanceManagementClientImpl class. */ public class ContainerInstanceManagementClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private ContainerInstanceManagementClientService service; /** the {@link AzureClient} used for long running operations. */ private AzureClient azureClient; @@ -238,6 +255,7 @@ protected void initialize() { this.containers = new ContainersInner(restClient().retrofit(), this); this.serviceAssociationLinks = new ServiceAssociationLinksInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); + initializeService(); } /** @@ -249,4 +267,190 @@ protected void initialize() { public String userAgent() { return String.format("%s (%s, %s)", super.userAgent(), "ContainerInstanceManagementClient", "2018-10-01"); } + + private void initializeService() { + service = restClient().retrofit().create(ContainerInstanceManagementClientService.class); + } + + /** + * The interface defining all the services for ContainerInstanceManagementClient to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerInstanceManagementClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerInstanceManagementClient listCachedImages" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/cachedImages") + Observable> listCachedImages(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @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.containerinstance.v2018_10_01.ContainerInstanceManagementClient listCapabilities" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/capabilities") + Observable> listCapabilities(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The identifier for the physical azure location. + * @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 CachedImagesListResultInner object if successful. + */ + public CachedImagesListResultInner listCachedImages(String location) { + return listCachedImagesWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The identifier for the physical azure location. + * @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 listCachedImagesAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listCachedImagesWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CachedImagesListResultInner object + */ + public Observable listCachedImagesAsync(String location) { + return listCachedImagesWithServiceResponseAsync(location).map(new Func1, CachedImagesListResultInner>() { + @Override + public CachedImagesListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CachedImagesListResultInner object + */ + public Observable> listCachedImagesWithServiceResponseAsync(String location) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + return service.listCachedImages(this.subscriptionId(), location, this.apiVersion(), this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listCachedImagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listCachedImagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The identifier for the physical azure location. + * @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 CapabilitiesListResultInner object if successful. + */ + public CapabilitiesListResultInner listCapabilities(String location) { + return listCapabilitiesWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The identifier for the physical azure location. + * @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 listCapabilitiesAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listCapabilitiesWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapabilitiesListResultInner object + */ + public Observable listCapabilitiesAsync(String location) { + return listCapabilitiesWithServiceResponseAsync(location).map(new Func1, CapabilitiesListResultInner>() { + @Override + public CapabilitiesListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapabilitiesListResultInner object + */ + public Observable> listCapabilitiesWithServiceResponseAsync(String location) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + return service.listCapabilities(this.subscriptionId(), location, this.apiVersion(), this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listCapabilitiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listCapabilitiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + } diff --git a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationInner.java b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationInner.java index 917f71f159c6..ddaca672719e 100644 --- a/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationInner.java +++ b/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationInner.java @@ -28,6 +28,12 @@ public class OperationInner { @JsonProperty(value = "display", required = true) private OperationDisplay display; + /** + * The additional properties. + */ + @JsonProperty(value = "properties") + private Object properties; + /** * The intended executor of the operation. Possible values include: 'User', * 'System'. @@ -75,6 +81,26 @@ public OperationInner withDisplay(OperationDisplay display) { return this; } + /** + * Get the additional properties. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the additional properties. + * + * @param properties the properties value to set + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + /** * Get the intended executor of the operation. Possible values include: 'User', 'System'. *