Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sdk/quota/azure-resourcemanager-quota/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.2 (Unreleased)
## 1.0.0-beta.1 (2021-10-21)

- Azure Resource Manager quota client library for Java. This package contains Microsoft Azure SDK for quota Management SDK. Microsoft Azure Quota Resource Provider. Package tag package-2021-03-15-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
2 changes: 1 addition & 1 deletion sdk/quota/azure-resourcemanager-quota/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-quota</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
68 changes: 33 additions & 35 deletions sdk/quota/azure-resourcemanager-quota/SAMPLE.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Code snippets and samples


## Operation

- [List](#operation_list)

## Quota

- [CreateOrUpdate](#quota_createorupdate)
- [Get](#quota_get)
- [List](#quota_list)
- [Update](#quota_update)

## QuotaOperation

- [List](#quotaoperation_list)

## QuotaRequestStatus

- [Get](#quotarequeststatus_get)
Expand All @@ -21,32 +21,10 @@

- [Get](#usages_get)
- [List](#usages_list)
### Operation_List

```java
import com.azure.core.util.Context;

/** Samples for Operation List. */
public final class OperationListSamples {
/*
* x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/GetOperations.json
*/
/**
* Sample code: GetOperations.
*
* @param manager Entry point to QuotaManager.
*/
public static void getOperations(com.azure.resourcemanager.quota.QuotaManager manager) {
manager.operations().list(Context.NONE);
}
}
```

### Quota_CreateOrUpdate

```java
import com.azure.resourcemanager.quota.models.LimitType;
import com.azure.resourcemanager.quota.models.LimitValue;
import com.azure.resourcemanager.quota.models.LimitObject;
import com.azure.resourcemanager.quota.models.QuotaProperties;
import com.azure.resourcemanager.quota.models.ResourceName;

Expand All @@ -69,7 +47,7 @@ public final class QuotaCreateOrUpdateSamples {
"subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.MachineLearningServices/locations/eastus")
.withProperties(
new QuotaProperties()
.withLimit(new LimitValue().withValue(10).withLimitObjectType(LimitType.LIMIT_VALUE))
.withLimit(new LimitObject().withValue(10))
.withName(new ResourceName().withValue("TotalLowPriorityCores"))
.withResourceType("lowPriority"))
.create();
Expand All @@ -92,7 +70,7 @@ public final class QuotaCreateOrUpdateSamples {
"subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Network/locations/eastus")
.withProperties(
new QuotaProperties()
.withLimit(new LimitValue().withValue(10).withLimitObjectType(LimitType.LIMIT_VALUE))
.withLimit(new LimitObject().withValue(10))
.withName(new ResourceName().withValue("StandardSkuPublicIpAddresses"))
.withResourceType("PublicIpAddresses"))
.create();
Expand All @@ -114,7 +92,7 @@ public final class QuotaCreateOrUpdateSamples {
"subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus")
.withProperties(
new QuotaProperties()
.withLimit(new LimitValue().withValue(10).withLimitObjectType(LimitType.LIMIT_VALUE))
.withLimit(new LimitObject().withValue(10))
.withName(new ResourceName().withValue("standardFSv2Family")))
.create();
}
Expand All @@ -135,7 +113,7 @@ public final class QuotaCreateOrUpdateSamples {
"subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Network/locations/eastus")
.withProperties(
new QuotaProperties()
.withLimit(new LimitValue().withValue(10).withLimitObjectType(LimitType.LIMIT_VALUE))
.withLimit(new LimitObject().withValue(10))
.withName(new ResourceName().withValue("MinPublicIpInterNetworkPrefixLength"))
.withResourceType("MinPublicIpInterNetworkPrefixLength"))
.create();
Expand Down Expand Up @@ -249,8 +227,7 @@ public final class QuotaListSamples {
```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.quota.models.CurrentQuotaLimitBase;
import com.azure.resourcemanager.quota.models.LimitType;
import com.azure.resourcemanager.quota.models.LimitValue;
import com.azure.resourcemanager.quota.models.LimitObject;
import com.azure.resourcemanager.quota.models.QuotaProperties;
import com.azure.resourcemanager.quota.models.ResourceName;

Expand All @@ -277,7 +254,7 @@ public final class QuotaUpdateSamples {
.update()
.withProperties(
new QuotaProperties()
.withLimit(new LimitValue().withValue(10).withLimitObjectType(LimitType.LIMIT_VALUE))
.withLimit(new LimitObject().withValue(10))
.withName(new ResourceName().withValue("standardFSv2Family")))
.apply();
}
Expand All @@ -303,14 +280,35 @@ public final class QuotaUpdateSamples {
.update()
.withProperties(
new QuotaProperties()
.withLimit(new LimitValue().withValue(10).withLimitObjectType(LimitType.LIMIT_VALUE))
.withLimit(new LimitObject().withValue(10))
.withName(new ResourceName().withValue("MinPublicIpInterNetworkPrefixLength"))
.withResourceType("MinPublicIpInterNetworkPrefixLength"))
.apply();
}
}
```

### QuotaOperation_List

```java
import com.azure.core.util.Context;

/** Samples for QuotaOperation List. */
public final class QuotaOperationListSamples {
/*
* x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/GetOperations.json
*/
/**
* Sample code: GetOperations.
*
* @param manager Entry point to QuotaManager.
*/
public static void getOperations(com.azure.resourcemanager.quota.QuotaManager manager) {
manager.quotaOperations().list(Context.NONE);
}
}
```

### QuotaRequestStatus_Get

```java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.quota.fluent.AzureQuotaExtensionApi;
import com.azure.resourcemanager.quota.implementation.AzureQuotaExtensionApiBuilder;
import com.azure.resourcemanager.quota.implementation.OperationsImpl;
import com.azure.resourcemanager.quota.implementation.QuotaOperationsImpl;
import com.azure.resourcemanager.quota.implementation.QuotaRequestStatusImpl;
import com.azure.resourcemanager.quota.implementation.QuotasImpl;
import com.azure.resourcemanager.quota.implementation.UsagesImpl;
import com.azure.resourcemanager.quota.models.Operations;
import com.azure.resourcemanager.quota.models.QuotaOperations;
import com.azure.resourcemanager.quota.models.QuotaRequestStatus;
import com.azure.resourcemanager.quota.models.Quotas;
import com.azure.resourcemanager.quota.models.Usages;
Expand All @@ -44,7 +44,7 @@ public final class QuotaManager {

private QuotaRequestStatus quotaRequestStatus;

private Operations operations;
private QuotaOperations quotaOperations;

private final AzureQuotaExtensionApi clientObject;

Expand Down Expand Up @@ -244,12 +244,12 @@ public QuotaRequestStatus quotaRequestStatus() {
return quotaRequestStatus;
}

/** @return Resource collection API of Operations. */
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
/** @return Resource collection API of QuotaOperations. */
public QuotaOperations quotaOperations() {
if (this.quotaOperations == null) {
this.quotaOperations = new QuotaOperationsImpl(clientObject.getQuotaOperations(), this);
}
return operations;
return quotaOperations;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public interface AzureQuotaExtensionApi {
QuotaRequestStatusClient getQuotaRequestStatus();

/**
* Gets the OperationsClient object to access its operations.
* Gets the QuotaOperationsClient object to access its operations.
*
* @return the OperationsClient object.
* @return the QuotaOperationsClient object.
*/
OperationsClient getOperations();
QuotaOperationsClient getQuotaOperations();
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import com.azure.core.util.Context;
import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner;

/** An instance of this class provides access to all the operations defined in OperationsClient. */
public interface OperationsClient {
/** An instance of this class provides access to all the operations defined in QuotaOperationsClient. */
public interface QuotaOperationsClient {
/**
* List all the operations supported by the Microsoft.Quota resource provider.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public interface QuotasClient {
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return quota limit.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<CurrentQuotaLimitBaseInner>, CurrentQuotaLimitBaseInner> beginCreateOrUpdate(
String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest);

Expand All @@ -97,7 +97,7 @@ SyncPoller<PollResult<CurrentQuotaLimitBaseInner>, CurrentQuotaLimitBaseInner> b
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return quota limit.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<CurrentQuotaLimitBaseInner>, CurrentQuotaLimitBaseInner> beginCreateOrUpdate(
String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest, Context context);

Expand Down Expand Up @@ -170,7 +170,7 @@ CurrentQuotaLimitBaseInner createOrUpdate(
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return quota limit.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<CurrentQuotaLimitBaseInner>, CurrentQuotaLimitBaseInner> beginUpdate(
String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest);

Expand All @@ -195,7 +195,7 @@ SyncPoller<PollResult<CurrentQuotaLimitBaseInner>, CurrentQuotaLimitBaseInner> b
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return quota limit.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<CurrentQuotaLimitBaseInner>, CurrentQuotaLimitBaseInner> beginUpdate(
String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest, Context context);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.azure.core.util.serializer.SerializerAdapter;
import com.azure.core.util.serializer.SerializerEncoding;
import com.azure.resourcemanager.quota.fluent.AzureQuotaExtensionApi;
import com.azure.resourcemanager.quota.fluent.OperationsClient;
import com.azure.resourcemanager.quota.fluent.QuotaOperationsClient;
import com.azure.resourcemanager.quota.fluent.QuotaRequestStatusClient;
import com.azure.resourcemanager.quota.fluent.QuotasClient;
import com.azure.resourcemanager.quota.fluent.UsagesClient;
Expand Down Expand Up @@ -137,16 +137,16 @@ public QuotaRequestStatusClient getQuotaRequestStatus() {
return this.quotaRequestStatus;
}

/** The OperationsClient object to access its operations. */
private final OperationsClient operations;
/** The QuotaOperationsClient object to access its operations. */
private final QuotaOperationsClient quotaOperations;

/**
* Gets the OperationsClient object to access its operations.
* Gets the QuotaOperationsClient object to access its operations.
*
* @return the OperationsClient object.
* @return the QuotaOperationsClient object.
*/
public OperationsClient getOperations() {
return this.operations;
public QuotaOperationsClient getQuotaOperations() {
return this.quotaOperations;
}

/**
Expand All @@ -172,7 +172,7 @@ public OperationsClient getOperations() {
this.usages = new UsagesClientImpl(this);
this.quotas = new QuotasClientImpl(this);
this.quotaRequestStatus = new QuotaRequestStatusClientImpl(this);
this.operations = new OperationsClientImpl(this);
this.quotaOperations = new QuotaOperationsClientImpl(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,39 @@
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.quota.fluent.OperationsClient;
import com.azure.resourcemanager.quota.fluent.QuotaOperationsClient;
import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner;
import com.azure.resourcemanager.quota.models.OperationList;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in OperationsClient. */
public final class OperationsClientImpl implements OperationsClient {
private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class);
/** An instance of this class provides access to all the operations defined in QuotaOperationsClient. */
public final class QuotaOperationsClientImpl implements QuotaOperationsClient {
private final ClientLogger logger = new ClientLogger(QuotaOperationsClientImpl.class);

/** The proxy service used to perform REST calls. */
private final OperationsService service;
private final QuotaOperationsService service;

/** The service client containing this operation class. */
private final AzureQuotaExtensionApiImpl client;

/**
* Initializes an instance of OperationsClientImpl.
* Initializes an instance of QuotaOperationsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
OperationsClientImpl(AzureQuotaExtensionApiImpl client) {
QuotaOperationsClientImpl(AzureQuotaExtensionApiImpl client) {
this.service =
RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
RestProxy.create(QuotaOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}

/**
* The interface defining all the services for AzureQuotaExtensionApiOperations to be used by the proxy service to
* perform REST calls.
* The interface defining all the services for AzureQuotaExtensionApiQuotaOperations to be used by the proxy service
* to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "AzureQuotaExtensionA")
private interface OperationsService {
private interface QuotaOperationsService {
@Headers({"Content-Type: application/json"})
@Get("/providers/Microsoft.Quota/operations")
@ExpectedResponses({200})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.quota.fluent.OperationsClient;
import com.azure.resourcemanager.quota.fluent.QuotaOperationsClient;
import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner;
import com.azure.resourcemanager.quota.models.OperationResponse;
import com.azure.resourcemanager.quota.models.Operations;
import com.azure.resourcemanager.quota.models.QuotaOperations;
import com.fasterxml.jackson.annotation.JsonIgnore;

public final class OperationsImpl implements Operations {
@JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class);
public final class QuotaOperationsImpl implements QuotaOperations {
@JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaOperationsImpl.class);

private final OperationsClient innerClient;
private final QuotaOperationsClient innerClient;

private final com.azure.resourcemanager.quota.QuotaManager serviceManager;

public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.quota.QuotaManager serviceManager) {
public QuotaOperationsImpl(
QuotaOperationsClient innerClient, com.azure.resourcemanager.quota.QuotaManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
Expand All @@ -35,7 +36,7 @@ public PagedIterable<OperationResponse> list(Context context) {
return Utils.mapPage(inner, inner1 -> new OperationResponseImpl(inner1, this.manager()));
}

private OperationsClient serviceClient() {
private QuotaOperationsClient serviceClient() {
return this.innerClient;
}

Expand Down
Loading