From 8698edb0b216e07120410d39b8594f29b098c217 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 22 Aug 2019 23:59:19 +0000 Subject: [PATCH] Generated from 7eeaed66faa7cb8f5c39f8270cf7750a8c59d17f Removing space, which was causing merge conflict. --- Quota/resource-manager/v2019_07_19/pom.xml | 133 ++++ .../CreateGenericQuotaRequestParameters.java | 45 ++ .../quota/v2019_07_19/CurrentQuotaLimit.java | 50 ++ .../v2019_07_19/CurrentQuotaLimitName.java | 70 ++ .../quota/v2019_07_19/ExceptionResponse.java | 43 ++ .../ExceptionResponseException.java | 44 ++ .../LocationProviderQuotaRequestDetails.java | 47 ++ ...ationProviderQuotaRequestDetailsModel.java | 49 ++ .../quota/v2019_07_19/QuotaLimits.java | 72 ++ .../quota/v2019_07_19/QuotaRequestStatus.java | 30 + .../quota/v2019_07_19/QuotaRequests.java | 43 ++ .../management/quota/v2019_07_19/Quotas.java | 30 + .../quota/v2019_07_19/ServiceError.java | 85 +++ .../quota/v2019_07_19/ServiceErrorDetail.java | 47 ++ .../quota/v2019_07_19/SubRequest.java | 114 +++ .../quota/v2019_07_19/SubRequestName.java | 47 ++ .../implementation/CapacityManager.java | 123 ++++ .../implementation/CurrentQuotaLimitImpl.java | 61 ++ .../CurrentQuotaLimitInner.java | 183 +++++ .../implementation/IdParsingUtils.java | 57 ++ ...cationProviderQuotaRequestDetailsImpl.java | 58 ++ ...nProviderQuotaRequestDetailsModelImpl.java | 69 ++ .../implementation/MicrosoftCapacityImpl.java | 247 +++++++ .../v2019_07_19/implementation/PageImpl.java | 75 ++ .../QuotaRequestDetailsInner.java | 118 +++ .../QuotaRequestStatusImpl.java | 46 ++ .../QuotaRequestStatusInner.java | 153 ++++ .../QuotaRequestSubmitResponseInner.java | 33 + .../implementation/QuotaRequestsImpl.java | 60 ++ .../implementation/QuotaRequestsInner.java | 670 ++++++++++++++++++ .../implementation/QuotasImpl.java | 53 ++ .../implementation/QuotasInner.java | 313 ++++++++ .../implementation/package-info.java | 11 + .../quota/v2019_07_19/package-info.java | 11 + 34 files changed, 3290 insertions(+) create mode 100644 Quota/resource-manager/v2019_07_19/pom.xml create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/CreateGenericQuotaRequestParameters.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/CurrentQuotaLimit.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/CurrentQuotaLimitName.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ExceptionResponse.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ExceptionResponseException.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/LocationProviderQuotaRequestDetails.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/LocationProviderQuotaRequestDetailsModel.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/QuotaLimits.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/QuotaRequestStatus.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/QuotaRequests.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/Quotas.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ServiceError.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ServiceErrorDetail.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/SubRequest.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/SubRequestName.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/CapacityManager.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/CurrentQuotaLimitImpl.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/CurrentQuotaLimitInner.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/IdParsingUtils.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/LocationProviderQuotaRequestDetailsImpl.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/LocationProviderQuotaRequestDetailsModelImpl.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/MicrosoftCapacityImpl.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/PageImpl.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestDetailsInner.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestStatusImpl.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestStatusInner.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestSubmitResponseInner.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestsImpl.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestsInner.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotasImpl.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotasInner.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/package-info.java create mode 100644 Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/package-info.java diff --git a/Quota/resource-manager/v2019_07_19/pom.xml b/Quota/resource-manager/v2019_07_19/pom.xml new file mode 100644 index 000000000000..f37681e6ec89 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.Quota.v2019_07_19 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-capacity + 1.0.0-beta + jar + Microsoft Azure SDK for Capacity Management + This package contains Microsoft Capacity 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/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/CreateGenericQuotaRequestParameters.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/CreateGenericQuotaRequestParameters.java new file mode 100644 index 000000000000..619e8e5d9ec3 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/CreateGenericQuotaRequestParameters.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.quota.v2019_07_19; + +import java.util.List; +import com.microsoft.azure.management.quota.v2019_07_19.implementation.CurrentQuotaLimitInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Quota change requests information. + */ +public class CreateGenericQuotaRequestParameters { + /** + * Quota change requests. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get quota change requests. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set quota change requests. + * + * @param value the value value to set + * @return the CreateGenericQuotaRequestParameters object itself. + */ + public CreateGenericQuotaRequestParameters withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/CurrentQuotaLimit.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/CurrentQuotaLimit.java new file mode 100644 index 000000000000..1470ec2d3cc8 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/CurrentQuotaLimit.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.quota.v2019_07_19; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.quota.v2019_07_19.implementation.CurrentQuotaLimitInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.quota.v2019_07_19.implementation.CapacityManager; + +/** + * Type representing CurrentQuotaLimit. + */ +public interface CurrentQuotaLimit extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Integer currentValue(); + + /** + * @return the limit value. + */ + Integer limit(); + + /** + * @return the name value. + */ + CurrentQuotaLimitName name(); + + /** + * @return the quotaPeriod value. + */ + String quotaPeriod(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/CurrentQuotaLimitName.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/CurrentQuotaLimitName.java new file mode 100644 index 000000000000..541f30109b9e --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/CurrentQuotaLimitName.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.quota.v2019_07_19; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Name of the resource provide by the resource Provider. Please use this name + * property for quotaRequests. + */ +public class CurrentQuotaLimitName { + /** + * Resource name. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Resource display name. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get resource name. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set resource name. + * + * @param value the value value to set + * @return the CurrentQuotaLimitName object itself. + */ + public CurrentQuotaLimitName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get resource display name. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set resource display name. + * + * @param localizedValue the localizedValue value to set + * @return the CurrentQuotaLimitName object itself. + */ + public CurrentQuotaLimitName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ExceptionResponse.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ExceptionResponse.java new file mode 100644 index 000000000000..ebf24fcc9802 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ExceptionResponse.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.quota.v2019_07_19; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The api error. + */ +public class ExceptionResponse { + /** + * The api error details. + */ + @JsonProperty(value = "error") + private ServiceError error; + + /** + * Get the api error details. + * + * @return the error value + */ + public ServiceError error() { + return this.error; + } + + /** + * Set the api error details. + * + * @param error the error value to set + * @return the ExceptionResponse object itself. + */ + public ExceptionResponse withError(ServiceError error) { + this.error = error; + return this; + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ExceptionResponseException.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ExceptionResponseException.java new file mode 100644 index 000000000000..ce03cfb28266 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ExceptionResponseException.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.quota.v2019_07_19; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ExceptionResponse information. + */ +public class ExceptionResponseException extends RestException { + /** + * Initializes a new instance of the ExceptionResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ExceptionResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ExceptionResponseException 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 ExceptionResponseException(final String message, final Response response, final ExceptionResponse body) { + super(message, response, body); + } + + @Override + public ExceptionResponse body() { + return (ExceptionResponse) super.body(); + } +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/LocationProviderQuotaRequestDetails.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/LocationProviderQuotaRequestDetails.java new file mode 100644 index 000000000000..e6e0e3066661 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/LocationProviderQuotaRequestDetails.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.quota.v2019_07_19; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.quota.v2019_07_19.implementation.QuotaRequestDetailsInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.quota.v2019_07_19.implementation.CapacityManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing LocationProviderQuotaRequestDetails. + */ +public interface LocationProviderQuotaRequestDetails extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the message value. + */ + String message(); + + /** + * @return the requestStatus value. + */ + Object requestStatus(); + + /** + * @return the requestSubmitTime value. + */ + DateTime requestSubmitTime(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/LocationProviderQuotaRequestDetailsModel.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/LocationProviderQuotaRequestDetailsModel.java new file mode 100644 index 000000000000..d47facc7ce86 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/LocationProviderQuotaRequestDetailsModel.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.quota.v2019_07_19; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.quota.v2019_07_19.implementation.QuotaRequestDetailsInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.quota.v2019_07_19.implementation.CapacityManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing LocationProviderQuotaRequestDetailsModel. + */ +public interface LocationProviderQuotaRequestDetailsModel extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the message value. + */ + String message(); + + /** + * @return the requestStatus value. + */ + Object requestStatus(); + + /** + * @return the requestSubmitTime value. + */ + DateTime requestSubmitTime(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/QuotaLimits.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/QuotaLimits.java new file mode 100644 index 000000000000..7911fd37e473 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/QuotaLimits.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.quota.v2019_07_19; + +import java.util.List; +import com.microsoft.azure.management.quota.v2019_07_19.implementation.CurrentQuotaLimitInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Quota limits. + */ +public class QuotaLimits { + /** + * List of Quota limits. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The uri to fetch the next page of quota limits. When there are no more + * pages, this is null. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get list of Quota limits. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of Quota limits. + * + * @param value the value value to set + * @return the QuotaLimits object itself. + */ + public QuotaLimits withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the uri to fetch the next page of quota limits. When there are no more pages, this is null. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the uri to fetch the next page of quota limits. When there are no more pages, this is null. + * + * @param nextLink the nextLink value to set + * @return the QuotaLimits object itself. + */ + public QuotaLimits withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/QuotaRequestStatus.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/QuotaRequestStatus.java new file mode 100644 index 000000000000..5ae3630e5ece --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/QuotaRequestStatus.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.quota.v2019_07_19; + +import rx.Observable; +import com.microsoft.azure.management.quota.v2019_07_19.implementation.QuotaRequestStatusInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing QuotaRequestStatus. + */ +public interface QuotaRequestStatus extends HasInner { + /** + * For the specified location, gets the Quota request status by requestId. + * Gets the QuotaRequest details and status by the quota requestId for the resources for the resource provider at a specific location. The requestId is returned as response to the Put requests for serviceLimits. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String providerId, String location); + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/QuotaRequests.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/QuotaRequests.java new file mode 100644 index 000000000000..2b79848eca32 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/QuotaRequests.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.quota.v2019_07_19; + +import rx.Observable; +import com.microsoft.azure.management.quota.v2019_07_19.implementation.QuotaRequestsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing QuotaRequests. + */ +public interface QuotaRequests extends HasInner { + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listStatusAsync(final String providerId, final String location); + + /** + * Submits a Quota Request for a resource provider at the specified location. + * Submits Quota change request for a resource provider for the specified location. To use, first make a Get request to get quota information. This information consists of a list of resources and information regarding those resources. For all the resources in that list which require an update to their quotas, update their limit fields in the response from the Get request to their new values. Then, submit this updated JSON object to this quota request API. This will update the quotas to the values specified. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param createQuotaRequests Quota requests payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createAsync(String providerId, String location, QuotaLimits createQuotaRequests); + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/Quotas.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/Quotas.java new file mode 100644 index 000000000000..66cbd62f786c --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/Quotas.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.quota.v2019_07_19; + +import rx.Observable; +import com.microsoft.azure.management.quota.v2019_07_19.implementation.QuotasInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Quotas. + */ +public interface Quotas extends HasInner { + /** + * Gets the current quota limit and usages for the resources provider for the specified location. + * This API gets the current quota limit and usages for the resources provider for the specified location. This response can be used to submit quotaRequests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listStatusAsync(final String providerId, final String location); + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ServiceError.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ServiceError.java new file mode 100644 index 000000000000..ee268a8bc581 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ServiceError.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.quota.v2019_07_19; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The api error details. + */ +public class ServiceError { + /** + * The error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The list of error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the error code. + * + * @param code the code value to set + * @return the ServiceError object itself. + */ + public ServiceError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the error message. + * + * @param message the message value to set + * @return the ServiceError object itself. + */ + public ServiceError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the list of error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ServiceErrorDetail.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ServiceErrorDetail.java new file mode 100644 index 000000000000..bb675330e6c3 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/ServiceErrorDetail.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.quota.v2019_07_19; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error details. + */ +public class ServiceErrorDetail { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/SubRequest.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/SubRequest.java new file mode 100644 index 000000000000..86c5d65c10d4 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/SubRequest.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.quota.v2019_07_19; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The sub-request submitted with the quota request. + */ +public class SubRequest { + /** + * The Resource limit. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /** + * User friendly status message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The Resource name. + */ + @JsonProperty(value = "name") + private SubRequestName name; + + /** + * Resource type for which the quota check was made. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * The quota request status. + */ + @JsonProperty(value = "requestStatus") + private Object requestStatus; + + /** + * Get the Resource limit. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Get user friendly status message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the Resource name. + * + * @return the name value + */ + public SubRequestName name() { + return this.name; + } + + /** + * Set the Resource name. + * + * @param name the name value to set + * @return the SubRequest object itself. + */ + public SubRequest withName(SubRequestName name) { + this.name = name; + return this; + } + + /** + * Get resource type for which the quota check was made. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the quota request status. + * + * @return the requestStatus value + */ + public Object requestStatus() { + return this.requestStatus; + } + + /** + * Set the quota request status. + * + * @param requestStatus the requestStatus value to set + * @return the SubRequest object itself. + */ + public SubRequest withRequestStatus(Object requestStatus) { + this.requestStatus = requestStatus; + return this; + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/SubRequestName.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/SubRequestName.java new file mode 100644 index 000000000000..cb99cf6dd68f --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/SubRequestName.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.quota.v2019_07_19; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Resource name. + */ +public class SubRequestName { + /** + * Resource display name. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Resource name. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get resource display name. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Get resource name. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/CapacityManager.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/CapacityManager.java new file mode 100644 index 000000000000..1009eb8f8a4e --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/CapacityManager.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.quota.v2019_07_19.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.quota.v2019_07_19.Quotas; +import com.microsoft.azure.management.quota.v2019_07_19.QuotaRequests; +import com.microsoft.azure.management.quota.v2019_07_19.QuotaRequestStatus; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Capacity resource management. + */ +public final class CapacityManager extends ManagerCore { + private Quotas quotas; + private QuotaRequests quotaRequests; + private QuotaRequestStatus quotaRequestStatus; + /** + * Get a Configurable instance that can be used to create CapacityManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new CapacityManager.ConfigurableImpl(); + } + /** + * Creates an instance of CapacityManager that exposes Capacity resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the CapacityManager + */ + public static CapacityManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new CapacityManager(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 CapacityManager that exposes Capacity resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the CapacityManager + */ + public static CapacityManager authenticate(RestClient restClient, String subscriptionId) { + return new CapacityManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of CapacityManager that exposes Capacity management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Capacity management API entry points that work across subscriptions + */ + CapacityManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Quotas. + */ + public Quotas quotas() { + if (this.quotas == null) { + this.quotas = new QuotasImpl(this); + } + return this.quotas; + } + + /** + * @return Entry point to manage QuotaRequests. + */ + public QuotaRequests quotaRequests() { + if (this.quotaRequests == null) { + this.quotaRequests = new QuotaRequestsImpl(this); + } + return this.quotaRequests; + } + + /** + * @return Entry point to manage QuotaRequestStatus. + */ + public QuotaRequestStatus quotaRequestStatus() { + if (this.quotaRequestStatus == null) { + this.quotaRequestStatus = new QuotaRequestStatusImpl(this); + } + return this.quotaRequestStatus; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public CapacityManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return CapacityManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private CapacityManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new MicrosoftCapacityImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/CurrentQuotaLimitImpl.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/CurrentQuotaLimitImpl.java new file mode 100644 index 000000000000..ba6ab0b68f90 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/CurrentQuotaLimitImpl.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.quota.v2019_07_19.implementation; + +import com.microsoft.azure.management.quota.v2019_07_19.CurrentQuotaLimit; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.quota.v2019_07_19.CurrentQuotaLimitName; + +class CurrentQuotaLimitImpl extends WrapperImpl implements CurrentQuotaLimit { + private final CapacityManager manager; + + CurrentQuotaLimitImpl(CurrentQuotaLimitInner inner, CapacityManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CapacityManager manager() { + return this.manager; + } + + + + @Override + public Integer currentValue() { + return this.inner().currentValue(); + } + + @Override + public Integer limit() { + return this.inner().limit(); + } + + @Override + public CurrentQuotaLimitName name() { + return this.inner().name(); + } + + @Override + public String quotaPeriod() { + return this.inner().quotaPeriod(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/CurrentQuotaLimitInner.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/CurrentQuotaLimitInner.java new file mode 100644 index 000000000000..c705d783ba9c --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/CurrentQuotaLimitInner.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.quota.v2019_07_19.implementation; + +import com.microsoft.azure.management.quota.v2019_07_19.CurrentQuotaLimitName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Quota limits. + */ +public class CurrentQuotaLimitInner { + /** + * The quota limit. + */ + @JsonProperty(value = "limit") + private Integer limit; + + /** + * The current resource usages information. + */ + @JsonProperty(value = "currentValue") + private Integer currentValue; + + /** + * Name of the resource provide by the resource Provider. Please use this + * name property for quotaRequests. + */ + @JsonProperty(value = "name") + private CurrentQuotaLimitName name; + + /** + * The resource type for the specific resource provider. For example, + * BatchAI has a resource type of ‘dedicated lowPriority cluster’. Call the + * /usages API and use the resource type and resource name from that API. + * This is an optional field because some resources, like compute, do not + * have a resource type. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /** + * The units of the limit, such as - Count, Bytes, etc. Use the unit field + * provided in the Get quota response. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * The quota period over which the usage values are summarized, such as - + * P1D (Per one day), PT1M (Per one minute), PT1S (Per one second). This + * parameter is optional because, for some resources like compute, the + * period doesn’t matter. + */ + @JsonProperty(value = "quotaPeriod") + private String quotaPeriod; + + /** + * Get the quota limit. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Set the quota limit. + * + * @param limit the limit value to set + * @return the CurrentQuotaLimitInner object itself. + */ + public CurrentQuotaLimitInner withLimit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Get the current resource usages information. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Set the current resource usages information. + * + * @param currentValue the currentValue value to set + * @return the CurrentQuotaLimitInner object itself. + */ + public CurrentQuotaLimitInner withCurrentValue(Integer currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get name of the resource provide by the resource Provider. Please use this name property for quotaRequests. + * + * @return the name value + */ + public CurrentQuotaLimitName name() { + return this.name; + } + + /** + * Set name of the resource provide by the resource Provider. Please use this name property for quotaRequests. + * + * @param name the name value to set + * @return the CurrentQuotaLimitInner object itself. + */ + public CurrentQuotaLimitInner withName(CurrentQuotaLimitName name) { + this.name = name; + return this; + } + + /** + * Get the resource type for the specific resource provider. For example, BatchAI has a resource type of ‘dedicated lowPriority cluster’. Call the /usages API and use the resource type and resource name from that API. This is an optional field because some resources, like compute, do not have a resource type. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resource type for the specific resource provider. For example, BatchAI has a resource type of ‘dedicated lowPriority cluster’. Call the /usages API and use the resource type and resource name from that API. This is an optional field because some resources, like compute, do not have a resource type. + * + * @param resourceType the resourceType value to set + * @return the CurrentQuotaLimitInner object itself. + */ + public CurrentQuotaLimitInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the units of the limit, such as - Count, Bytes, etc. Use the unit field provided in the Get quota response. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set the units of the limit, such as - Count, Bytes, etc. Use the unit field provided in the Get quota response. + * + * @param unit the unit value to set + * @return the CurrentQuotaLimitInner object itself. + */ + public CurrentQuotaLimitInner withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the quota period over which the usage values are summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per one second). This parameter is optional because, for some resources like compute, the period doesn’t matter. + * + * @return the quotaPeriod value + */ + public String quotaPeriod() { + return this.quotaPeriod; + } + + /** + * Set the quota period over which the usage values are summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per one second). This parameter is optional because, for some resources like compute, the period doesn’t matter. + * + * @param quotaPeriod the quotaPeriod value to set + * @return the CurrentQuotaLimitInner object itself. + */ + public CurrentQuotaLimitInner withQuotaPeriod(String quotaPeriod) { + this.quotaPeriod = quotaPeriod; + return this; + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/IdParsingUtils.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..52845f882850 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/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.quota.v2019_07_19.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/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/LocationProviderQuotaRequestDetailsImpl.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/LocationProviderQuotaRequestDetailsImpl.java new file mode 100644 index 000000000000..fb212508e501 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/LocationProviderQuotaRequestDetailsImpl.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.quota.v2019_07_19.implementation; + +import com.microsoft.azure.management.quota.v2019_07_19.LocationProviderQuotaRequestDetails; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.quota.v2019_07_19.SubRequest; + +class LocationProviderQuotaRequestDetailsImpl extends WrapperImpl implements LocationProviderQuotaRequestDetails { + private final CapacityManager manager; + + LocationProviderQuotaRequestDetailsImpl(QuotaRequestDetailsInner inner, CapacityManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CapacityManager manager() { + return this.manager; + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Object requestStatus() { + return this.inner().requestStatus(); + } + + @Override + public DateTime requestSubmitTime() { + return this.inner().requestSubmitTime(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/LocationProviderQuotaRequestDetailsModelImpl.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/LocationProviderQuotaRequestDetailsModelImpl.java new file mode 100644 index 000000000000..f16654a3a3b2 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/LocationProviderQuotaRequestDetailsModelImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.quota.v2019_07_19.implementation; + +import com.microsoft.azure.management.quota.v2019_07_19.LocationProviderQuotaRequestDetailsModel; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.quota.v2019_07_19.SubRequest; + +class LocationProviderQuotaRequestDetailsModelImpl extends IndexableRefreshableWrapperImpl implements LocationProviderQuotaRequestDetailsModel { + private final CapacityManager manager; + private String providerId; + private String location; + + LocationProviderQuotaRequestDetailsModelImpl(QuotaRequestDetailsInner inner, CapacityManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.providerId = IdParsingUtils.getValueFromIdByName(inner.id(), "providers"); + this.location = IdParsingUtils.getValueFromIdByName(inner.id(), "locations"); + } + + @Override + public CapacityManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + QuotaRequestStatusInner client = this.manager().inner().quotaRequestStatus(); + return client.getAsync(this.providerId, this.location); + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Object requestStatus() { + return this.inner().requestStatus(); + } + + @Override + public DateTime requestSubmitTime() { + return this.inner().requestSubmitTime(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/MicrosoftCapacityImpl.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/MicrosoftCapacityImpl.java new file mode 100644 index 000000000000..9bf6586a030b --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/MicrosoftCapacityImpl.java @@ -0,0 +1,247 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.quota.v2019_07_19.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 MicrosoftCapacityImpl class. + */ +public class MicrosoftCapacityImpl 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 MicrosoftCapacityImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Api version. */ + private String apiVersion; + + /** + * Gets Api version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Quota Request id. */ + private String id; + + /** + * Gets Quota Request id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Sets Quota Request id. + * + * @param id the id value. + * @return the service client itself + */ + public MicrosoftCapacityImpl withId(String id) { + this.id = id; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public MicrosoftCapacityImpl 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 MicrosoftCapacityImpl 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 MicrosoftCapacityImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The QuotasInner object to access its operations. + */ + private QuotasInner quotas; + + /** + * Gets the QuotasInner object to access its operations. + * @return the QuotasInner object. + */ + public QuotasInner quotas() { + return this.quotas; + } + + /** + * The QuotaRequestsInner object to access its operations. + */ + private QuotaRequestsInner quotaRequests; + + /** + * Gets the QuotaRequestsInner object to access its operations. + * @return the QuotaRequestsInner object. + */ + public QuotaRequestsInner quotaRequests() { + return this.quotaRequests; + } + + /** + * The QuotaRequestStatusInner object to access its operations. + */ + private QuotaRequestStatusInner quotaRequestStatus; + + /** + * Gets the QuotaRequestStatusInner object to access its operations. + * @return the QuotaRequestStatusInner object. + */ + public QuotaRequestStatusInner quotaRequestStatus() { + return this.quotaRequestStatus; + } + + /** + * Initializes an instance of MicrosoftCapacity client. + * + * @param credentials the management credentials for Azure + */ + public MicrosoftCapacityImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of MicrosoftCapacity client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public MicrosoftCapacityImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of MicrosoftCapacity client. + * + * @param restClient the REST client to connect to Azure. + */ + public MicrosoftCapacityImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2019-07-19-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.quotas = new QuotasInner(restClient().retrofit(), this); + this.quotaRequests = new QuotaRequestsInner(restClient().retrofit(), this); + this.quotaRequestStatus = new QuotaRequestStatusInner(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(), "MicrosoftCapacity", "2019-07-19-preview"); + } +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/PageImpl.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/PageImpl.java new file mode 100644 index 000000000000..12ff5e6030ae --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/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.quota.v2019_07_19.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/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestDetailsInner.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestDetailsInner.java new file mode 100644 index 000000000000..42c8017ca083 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestDetailsInner.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.quota.v2019_07_19.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.quota.v2019_07_19.SubRequest; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The details of the quota Request. + */ +public class QuotaRequestDetailsInner { + /** + * The quota request Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The quota request submit time. The date conforms to the following + * format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + */ + @JsonProperty(value = "requestSubmitTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime requestSubmitTime; + + /** + * User friendly status message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The quota request status. + */ + @JsonProperty(value = "requestStatus") + private Object requestStatus; + + /** + * The quotaRequests. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the quota request Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the quota request submit time. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + * + * @return the requestSubmitTime value + */ + public DateTime requestSubmitTime() { + return this.requestSubmitTime; + } + + /** + * Get user friendly status message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the quota request status. + * + * @return the requestStatus value + */ + public Object requestStatus() { + return this.requestStatus; + } + + /** + * Set the quota request status. + * + * @param requestStatus the requestStatus value to set + * @return the QuotaRequestDetailsInner object itself. + */ + public QuotaRequestDetailsInner withRequestStatus(Object requestStatus) { + this.requestStatus = requestStatus; + return this; + } + + /** + * Get the quotaRequests. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the quotaRequests. + * + * @param value the value value to set + * @return the QuotaRequestDetailsInner object itself. + */ + public QuotaRequestDetailsInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestStatusImpl.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestStatusImpl.java new file mode 100644 index 000000000000..5618db2dbc86 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestStatusImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.quota.v2019_07_19.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.quota.v2019_07_19.QuotaRequestStatus; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.quota.v2019_07_19.LocationProviderQuotaRequestDetailsModel; + +class QuotaRequestStatusImpl extends WrapperImpl implements QuotaRequestStatus { + private final CapacityManager manager; + + QuotaRequestStatusImpl(CapacityManager manager) { + super(manager.inner().quotaRequestStatus()); + this.manager = manager; + } + + public CapacityManager manager() { + return this.manager; + } + + private LocationProviderQuotaRequestDetailsModelImpl wrapModel(QuotaRequestDetailsInner inner) { + return new LocationProviderQuotaRequestDetailsModelImpl(inner, manager()); + } + + @Override + public Observable getAsync(String providerId, String location) { + QuotaRequestStatusInner client = this.inner(); + return client.getAsync(providerId, location) + .map(new Func1() { + @Override + public LocationProviderQuotaRequestDetailsModel call(QuotaRequestDetailsInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestStatusInner.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestStatusInner.java new file mode 100644 index 000000000000..df96a3650a31 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestStatusInner.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.quota.v2019_07_19.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.quota.v2019_07_19.ExceptionResponseException; +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; + +/** + * An instance of this class provides access to all the operations defined + * in QuotaRequestStatus. + */ +public class QuotaRequestStatusInner { + /** The Retrofit service to perform REST calls. */ + private QuotaRequestStatusService service; + /** The service client containing this operation class. */ + private MicrosoftCapacityImpl client; + + /** + * Initializes an instance of QuotaRequestStatusInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public QuotaRequestStatusInner(Retrofit retrofit, MicrosoftCapacityImpl client) { + this.service = retrofit.create(QuotaRequestStatusService.class); + this.client = client; + } + + /** + * The interface defining all the services for QuotaRequestStatus to be + * used by Retrofit to perform actually REST calls. + */ + interface QuotaRequestStatusService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.quota.v2019_07_19.QuotaRequestStatus get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Capacity/providers/{providerId}/locations/{location}/quotaRequests/{id}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("providerId") String providerId, @Path("location") String location, @Path("id") String id, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * For the specified location, gets the Quota request status by requestId. + * Gets the QuotaRequest details and status by the quota requestId for the resources for the resource provider at a specific location. The requestId is returned as response to the Put requests for serviceLimits. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QuotaRequestDetailsInner object if successful. + */ + public QuotaRequestDetailsInner get(String providerId, String location) { + return getWithServiceResponseAsync(providerId, location).toBlocking().single().body(); + } + + /** + * For the specified location, gets the Quota request status by requestId. + * Gets the QuotaRequest details and status by the quota requestId for the resources for the resource provider at a specific location. The requestId is returned as response to the Put requests for serviceLimits. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String providerId, String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(providerId, location), serviceCallback); + } + + /** + * For the specified location, gets the Quota request status by requestId. + * Gets the QuotaRequest details and status by the quota requestId for the resources for the resource provider at a specific location. The requestId is returned as response to the Put requests for serviceLimits. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QuotaRequestDetailsInner object + */ + public Observable getAsync(String providerId, String location) { + return getWithServiceResponseAsync(providerId, location).map(new Func1, QuotaRequestDetailsInner>() { + @Override + public QuotaRequestDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * For the specified location, gets the Quota request status by requestId. + * Gets the QuotaRequest details and status by the quota requestId for the resources for the resource provider at a specific location. The requestId is returned as response to the Put requests for serviceLimits. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QuotaRequestDetailsInner object + */ + public Observable> getWithServiceResponseAsync(String providerId, String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (providerId == null) { + throw new IllegalArgumentException("Parameter providerId is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.id() == null) { + throw new IllegalArgumentException("Parameter this.client.id() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), providerId, location, this.client.id(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestSubmitResponseInner.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestSubmitResponseInner.java new file mode 100644 index 000000000000..5664da4d2b81 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestSubmitResponseInner.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.quota.v2019_07_19.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The quota request submit response with request id. + */ +public class QuotaRequestSubmitResponseInner { + /** + * The quota request id. Please use the requestId to check the request + * status. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the quota request id. Please use the requestId to check the request status. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestsImpl.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestsImpl.java new file mode 100644 index 000000000000..e2002eb942d5 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestsImpl.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.quota.v2019_07_19.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.quota.v2019_07_19.QuotaRequests; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.quota.v2019_07_19.LocationProviderQuotaRequestDetails; +import com.microsoft.azure.management.quota.v2019_07_19.QuotaLimits; + +class QuotaRequestsImpl extends WrapperImpl implements QuotaRequests { + private final CapacityManager manager; + + QuotaRequestsImpl(CapacityManager manager) { + super(manager.inner().quotaRequests()); + this.manager = manager; + } + + public CapacityManager manager() { + return this.manager; + } + + private LocationProviderQuotaRequestDetailsImpl wrapModel(QuotaRequestDetailsInner inner) { + return new LocationProviderQuotaRequestDetailsImpl(inner, manager()); + } + + @Override + public Observable listStatusAsync(final String providerId, final String location) { + QuotaRequestsInner client = this.inner(); + return client.listStatusAsync(providerId, location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LocationProviderQuotaRequestDetails call(QuotaRequestDetailsInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable createAsync(String providerId, String location, QuotaLimits createQuotaRequests) { + QuotaRequestsInner client = this.inner(); + return client.createAsync(providerId, location, createQuotaRequests) + ;} + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestsInner.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestsInner.java new file mode 100644 index 000000000000..4b46ecfb4ac2 --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotaRequestsInner.java @@ -0,0 +1,670 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.quota.v2019_07_19.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.quota.v2019_07_19.ExceptionResponseException; +import com.microsoft.azure.management.quota.v2019_07_19.QuotaLimits; +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.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in QuotaRequests. + */ +public class QuotaRequestsInner { + /** The Retrofit service to perform REST calls. */ + private QuotaRequestsService service; + /** The service client containing this operation class. */ + private MicrosoftCapacityImpl client; + + /** + * Initializes an instance of QuotaRequestsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public QuotaRequestsInner(Retrofit retrofit, MicrosoftCapacityImpl client) { + this.service = retrofit.create(QuotaRequestsService.class); + this.client = client; + } + + /** + * The interface defining all the services for QuotaRequests to be + * used by Retrofit to perform actually REST calls. + */ + interface QuotaRequestsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.quota.v2019_07_19.QuotaRequests create" }) + @PUT("subscriptions/{subscriptionId}/providers/Microsoft.Capacity/providers/{providerId}/locations/{location}/serviceLimits") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("providerId") String providerId, @Path("location") String location, @Query("api-version") String apiVersion, @Body QuotaLimits createQuotaRequests, @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.quota.v2019_07_19.QuotaRequests beginCreate" }) + @PUT("subscriptions/{subscriptionId}/providers/Microsoft.Capacity/providers/{providerId}/locations/{location}/serviceLimits") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("providerId") String providerId, @Path("location") String location, @Query("api-version") String apiVersion, @Body QuotaLimits createQuotaRequests, @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.quota.v2019_07_19.QuotaRequests listStatus" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Capacity/providers/{providerId}/locations/{location}/quotaRequests") + Observable> listStatus(@Path("subscriptionId") String subscriptionId, @Path("providerId") String providerId, @Path("location") String location, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$skip") Integer skip, @Query("$top") Integer top, @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.quota.v2019_07_19.QuotaRequests listStatusNext" }) + @GET + Observable> listStatusNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Submits a Quota Request for a resource provider at the specified location. + * Submits Quota change request for a resource provider for the specified location. To use, first make a Get request to get quota information. This information consists of a list of resources and information regarding those resources. For all the resources in that list which require an update to their quotas, update their limit fields in the response from the Get request to their new values. Then, submit this updated JSON object to this quota request API. This will update the quotas to the values specified. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param createQuotaRequests Quota requests payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException 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 create(String providerId, String location, QuotaLimits createQuotaRequests) { + return createWithServiceResponseAsync(providerId, location, createQuotaRequests).toBlocking().last().body(); + } + + /** + * Submits a Quota Request for a resource provider at the specified location. + * Submits Quota change request for a resource provider for the specified location. To use, first make a Get request to get quota information. This information consists of a list of resources and information regarding those resources. For all the resources in that list which require an update to their quotas, update their limit fields in the response from the Get request to their new values. Then, submit this updated JSON object to this quota request API. This will update the quotas to the values specified. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param createQuotaRequests Quota requests payload. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String providerId, String location, QuotaLimits createQuotaRequests, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(providerId, location, createQuotaRequests), serviceCallback); + } + + /** + * Submits a Quota Request for a resource provider at the specified location. + * Submits Quota change request for a resource provider for the specified location. To use, first make a Get request to get quota information. This information consists of a list of resources and information regarding those resources. For all the resources in that list which require an update to their quotas, update their limit fields in the response from the Get request to their new values. Then, submit this updated JSON object to this quota request API. This will update the quotas to the values specified. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param createQuotaRequests Quota requests payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String providerId, String location, QuotaLimits createQuotaRequests) { + return createWithServiceResponseAsync(providerId, location, createQuotaRequests).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Submits a Quota Request for a resource provider at the specified location. + * Submits Quota change request for a resource provider for the specified location. To use, first make a Get request to get quota information. This information consists of a list of resources and information regarding those resources. For all the resources in that list which require an update to their quotas, update their limit fields in the response from the Get request to their new values. Then, submit this updated JSON object to this quota request API. This will update the quotas to the values specified. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param createQuotaRequests Quota requests payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String providerId, String location, QuotaLimits createQuotaRequests) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (providerId == null) { + throw new IllegalArgumentException("Parameter providerId is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createQuotaRequests == null) { + throw new IllegalArgumentException("Parameter createQuotaRequests is required and cannot be null."); + } + Validator.validate(createQuotaRequests); + Observable> observable = service.create(this.client.subscriptionId(), providerId, location, this.client.apiVersion(), createQuotaRequests, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Submits a Quota Request for a resource provider at the specified location. + * Submits Quota change request for a resource provider for the specified location. To use, first make a Get request to get quota information. This information consists of a list of resources and information regarding those resources. For all the resources in that list which require an update to their quotas, update their limit fields in the response from the Get request to their new values. Then, submit this updated JSON object to this quota request API. This will update the quotas to the values specified. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param createQuotaRequests Quota requests payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException 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 beginCreate(String providerId, String location, QuotaLimits createQuotaRequests) { + return beginCreateWithServiceResponseAsync(providerId, location, createQuotaRequests).toBlocking().single().body(); + } + + /** + * Submits a Quota Request for a resource provider at the specified location. + * Submits Quota change request for a resource provider for the specified location. To use, first make a Get request to get quota information. This information consists of a list of resources and information regarding those resources. For all the resources in that list which require an update to their quotas, update their limit fields in the response from the Get request to their new values. Then, submit this updated JSON object to this quota request API. This will update the quotas to the values specified. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param createQuotaRequests Quota requests payload. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String providerId, String location, QuotaLimits createQuotaRequests, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(providerId, location, createQuotaRequests), serviceCallback); + } + + /** + * Submits a Quota Request for a resource provider at the specified location. + * Submits Quota change request for a resource provider for the specified location. To use, first make a Get request to get quota information. This information consists of a list of resources and information regarding those resources. For all the resources in that list which require an update to their quotas, update their limit fields in the response from the Get request to their new values. Then, submit this updated JSON object to this quota request API. This will update the quotas to the values specified. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param createQuotaRequests Quota requests payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable beginCreateAsync(String providerId, String location, QuotaLimits createQuotaRequests) { + return beginCreateWithServiceResponseAsync(providerId, location, createQuotaRequests).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Submits a Quota Request for a resource provider at the specified location. + * Submits Quota change request for a resource provider for the specified location. To use, first make a Get request to get quota information. This information consists of a list of resources and information regarding those resources. For all the resources in that list which require an update to their quotas, update their limit fields in the response from the Get request to their new values. Then, submit this updated JSON object to this quota request API. This will update the quotas to the values specified. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param createQuotaRequests Quota requests payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> beginCreateWithServiceResponseAsync(String providerId, String location, QuotaLimits createQuotaRequests) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (providerId == null) { + throw new IllegalArgumentException("Parameter providerId is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createQuotaRequests == null) { + throw new IllegalArgumentException("Parameter createQuotaRequests is required and cannot be null."); + } + Validator.validate(createQuotaRequests); + return service.beginCreate(this.client.subscriptionId(), providerId, location, this.client.apiVersion(), createQuotaRequests, 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 ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException 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<QuotaRequestDetailsInner> object if successful. + */ + public PagedList listStatus(final String providerId, final String location) { + ServiceResponse> response = listStatusSinglePageAsync(providerId, location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listStatusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @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> listStatusAsync(final String providerId, final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listStatusSinglePageAsync(providerId, location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listStatusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaRequestDetailsInner> object + */ + public Observable> listStatusAsync(final String providerId, final String location) { + return listStatusWithServiceResponseAsync(providerId, location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaRequestDetailsInner> object + */ + public Observable>> listStatusWithServiceResponseAsync(final String providerId, final String location) { + return listStatusSinglePageAsync(providerId, location) + .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(listStatusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QuotaRequestDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listStatusSinglePageAsync(final String providerId, final String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (providerId == null) { + throw new IllegalArgumentException("Parameter providerId 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 filter = null; + final Integer skip = null; + final Integer top = null; + return service.listStatus(this.client.subscriptionId(), providerId, location, this.client.apiVersion(), filter, skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listStatusDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param filter | Field | Supported operators + |---------------------|------------------------ + |requestSubmitTime | ge, le, eq, gt, lt + * @param skip Number of records to skip. + * @param top Number of records to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException 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<QuotaRequestDetailsInner> object if successful. + */ + public PagedList listStatus(final String providerId, final String location, final String filter, final Integer skip, final Integer top) { + ServiceResponse> response = listStatusSinglePageAsync(providerId, location, filter, skip, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listStatusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param filter | Field | Supported operators + |---------------------|------------------------ + |requestSubmitTime | ge, le, eq, gt, lt + * @param skip Number of records to skip. + * @param top Number of records to return. + * @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> listStatusAsync(final String providerId, final String location, final String filter, final Integer skip, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listStatusSinglePageAsync(providerId, location, filter, skip, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listStatusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param filter | Field | Supported operators + |---------------------|------------------------ + |requestSubmitTime | ge, le, eq, gt, lt + * @param skip Number of records to skip. + * @param top Number of records to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaRequestDetailsInner> object + */ + public Observable> listStatusAsync(final String providerId, final String location, final String filter, final Integer skip, final Integer top) { + return listStatusWithServiceResponseAsync(providerId, location, filter, skip, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param filter | Field | Supported operators + |---------------------|------------------------ + |requestSubmitTime | ge, le, eq, gt, lt + * @param skip Number of records to skip. + * @param top Number of records to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QuotaRequestDetailsInner> object + */ + public Observable>> listStatusWithServiceResponseAsync(final String providerId, final String location, final String filter, final Integer skip, final Integer top) { + return listStatusSinglePageAsync(providerId, location, filter, skip, top) + .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(listStatusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + ServiceResponse> * @param providerId Azure resource Provider id. + ServiceResponse> * @param location Azure region. + ServiceResponse> * @param filter | Field | Supported operators + |---------------------|------------------------ + |requestSubmitTime | ge, le, eq, gt, lt + ServiceResponse> * @param skip Number of records to skip. + ServiceResponse> * @param top Number of records to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QuotaRequestDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listStatusSinglePageAsync(final String providerId, final String location, final String filter, final Integer skip, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (providerId == null) { + throw new IllegalArgumentException("Parameter providerId 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."); + } + return service.listStatus(this.client.subscriptionId(), providerId, location, this.client.apiVersion(), filter, skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listStatusDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listStatusDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ExceptionResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException 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<QuotaRequestDetailsInner> object if successful. + */ + public PagedList listStatusNext(final String nextPageLink) { + ServiceResponse> response = listStatusNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listStatusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + * @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> listStatusNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listStatusNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listStatusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + * @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<QuotaRequestDetailsInner> object + */ + public Observable> listStatusNextAsync(final String nextPageLink) { + return listStatusNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + * @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<QuotaRequestDetailsInner> object + */ + public Observable>> listStatusNextWithServiceResponseAsync(final String nextPageLink) { + return listStatusNextSinglePageAsync(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(listStatusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * For the specified location and resource Provider, gets the current quota requests under the subscription over the time + period of one year ago from now to one year back. + * For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QuotaRequestDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listStatusNextSinglePageAsync(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.listStatusNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listStatusNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listStatusNextDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ExceptionResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotasImpl.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotasImpl.java new file mode 100644 index 000000000000..371a3d2e707f --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotasImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.quota.v2019_07_19.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.quota.v2019_07_19.Quotas; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.quota.v2019_07_19.CurrentQuotaLimit; + +class QuotasImpl extends WrapperImpl implements Quotas { + private final CapacityManager manager; + + QuotasImpl(CapacityManager manager) { + super(manager.inner().quotas()); + this.manager = manager; + } + + public CapacityManager manager() { + return this.manager; + } + + private CurrentQuotaLimitImpl wrapModel(CurrentQuotaLimitInner inner) { + return new CurrentQuotaLimitImpl(inner, manager()); + } + + @Override + public Observable listStatusAsync(final String providerId, final String location) { + QuotasInner client = this.inner(); + return client.listStatusAsync(providerId, location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public CurrentQuotaLimit call(CurrentQuotaLimitInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotasInner.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotasInner.java new file mode 100644 index 000000000000..ce23bc29de9a --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/QuotasInner.java @@ -0,0 +1,313 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.quota.v2019_07_19.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.quota.v2019_07_19.ExceptionResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Quotas. + */ +public class QuotasInner { + /** The Retrofit service to perform REST calls. */ + private QuotasService service; + /** The service client containing this operation class. */ + private MicrosoftCapacityImpl client; + + /** + * Initializes an instance of QuotasInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public QuotasInner(Retrofit retrofit, MicrosoftCapacityImpl client) { + this.service = retrofit.create(QuotasService.class); + this.client = client; + } + + /** + * The interface defining all the services for Quotas to be + * used by Retrofit to perform actually REST calls. + */ + interface QuotasService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.quota.v2019_07_19.Quotas listStatus" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Capacity/providers/{providerId}/locations/{location}/serviceLimits") + Observable> listStatus(@Path("subscriptionId") String subscriptionId, @Path("providerId") String providerId, @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.quota.v2019_07_19.Quotas listStatusNext" }) + @GET + Observable> listStatusNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the current quota limit and usages for the resources provider for the specified location. + * This API gets the current quota limit and usages for the resources provider for the specified location. This response can be used to submit quotaRequests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException 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<CurrentQuotaLimitInner> object if successful. + */ + public PagedList listStatus(final String providerId, final String location) { + ServiceResponse> response = listStatusSinglePageAsync(providerId, location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listStatusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the current quota limit and usages for the resources provider for the specified location. + * This API gets the current quota limit and usages for the resources provider for the specified location. This response can be used to submit quotaRequests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @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> listStatusAsync(final String providerId, final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listStatusSinglePageAsync(providerId, location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listStatusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the current quota limit and usages for the resources provider for the specified location. + * This API gets the current quota limit and usages for the resources provider for the specified location. This response can be used to submit quotaRequests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CurrentQuotaLimitInner> object + */ + public Observable> listStatusAsync(final String providerId, final String location) { + return listStatusWithServiceResponseAsync(providerId, location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the current quota limit and usages for the resources provider for the specified location. + * This API gets the current quota limit and usages for the resources provider for the specified location. This response can be used to submit quotaRequests. + * + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CurrentQuotaLimitInner> object + */ + public Observable>> listStatusWithServiceResponseAsync(final String providerId, final String location) { + return listStatusSinglePageAsync(providerId, location) + .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(listStatusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the current quota limit and usages for the resources provider for the specified location. + * This API gets the current quota limit and usages for the resources provider for the specified location. This response can be used to submit quotaRequests. + * + ServiceResponse> * @param providerId Azure resource Provider id. + ServiceResponse> * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CurrentQuotaLimitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listStatusSinglePageAsync(final String providerId, final String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (providerId == null) { + throw new IllegalArgumentException("Parameter providerId 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."); + } + return service.listStatus(this.client.subscriptionId(), providerId, location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listStatusDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listStatusDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ExceptionResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + + /** + * Gets the current quota limit and usages for the resources provider for the specified location. + * This API gets the current quota limit and usages for the resources provider for the specified location. This response can be used to submit quotaRequests. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException 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<CurrentQuotaLimitInner> object if successful. + */ + public PagedList listStatusNext(final String nextPageLink) { + ServiceResponse> response = listStatusNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listStatusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the current quota limit and usages for the resources provider for the specified location. + * This API gets the current quota limit and usages for the resources provider for the specified location. This response can be used to submit quotaRequests. + * + * @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> listStatusNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listStatusNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listStatusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the current quota limit and usages for the resources provider for the specified location. + * This API gets the current quota limit and usages for the resources provider for the specified location. This response can be used to submit quotaRequests. + * + * @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<CurrentQuotaLimitInner> object + */ + public Observable> listStatusNextAsync(final String nextPageLink) { + return listStatusNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the current quota limit and usages for the resources provider for the specified location. + * This API gets the current quota limit and usages for the resources provider for the specified location. This response can be used to submit quotaRequests. + * + * @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<CurrentQuotaLimitInner> object + */ + public Observable>> listStatusNextWithServiceResponseAsync(final String nextPageLink) { + return listStatusNextSinglePageAsync(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(listStatusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the current quota limit and usages for the resources provider for the specified location. + * This API gets the current quota limit and usages for the resources provider for the specified location. This response can be used to submit quotaRequests. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CurrentQuotaLimitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listStatusNextSinglePageAsync(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.listStatusNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listStatusNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listStatusNextDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ExceptionResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + +} diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/package-info.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/implementation/package-info.java new file mode 100644 index 000000000000..7bc60363a12d --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/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 MicrosoftCapacity. + * Microsoft Azure Quota Resource Provider. + */ +package com.microsoft.azure.management.quota.v2019_07_19.implementation; diff --git a/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/package-info.java b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/package-info.java new file mode 100644 index 000000000000..ee705ce2478a --- /dev/null +++ b/Quota/resource-manager/v2019_07_19/src/main/java/com/microsoft/azure/management/quota/v2019_07_19/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 MicrosoftCapacity. + * Microsoft Azure Quota Resource Provider. + */ +package com.microsoft.azure.management.quota.v2019_07_19;