Skip to content

Commit

Permalink
mgmt, add databoundary client to resources (#42131)
Browse files Browse the repository at this point in the history
* config

* handwritten code for accessing client via manager

* codegen

* changelog

* test, temporary switch to working api-version 2024-03-01
  • Loading branch information
weidongxu-microsoft authored Sep 30, 2024
1 parent 247c1b9 commit d2dbba0
Show file tree
Hide file tree
Showing 19 changed files with 1,404 additions and 6 deletions.
6 changes: 6 additions & 0 deletions sdk/resourcemanager/api-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,11 @@
"source": "specification/resources/resource-manager/readme.md",
"package": "com.azure.resourcemanager.resources",
"args": "--tag=package-changes-2022-05 --graalvm-config-suffix=change --rename-model=ChangeType:ResourceChangeType,PropertyChangeType:ResourcePropertyChangeType"
},
"databoundaries": {
"dir": "azure-resourcemanager-resources",
"source": "specification/resources/resource-manager/readme.md",
"package": "com.azure.resourcemanager.resources",
"args": "--tag=package-databoundaries-2024-08 --title=DataBoundariesManagementClient --graalvm-config-suffix=databoundary --remove-operation-group=Operations"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
- Added data boundary client of api-version 2024-03-01.

## 2.43.0 (2024-09-27)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/resourcemanager/azure-resourcemanager-resources",
"Tag": "java/resourcemanager/azure-resourcemanager-resources_0725d576ae"
"Tag": "java/resourcemanager/azure-resourcemanager-resources_f8a1e5fca6"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
import com.azure.core.credential.TokenCredential;
import com.azure.core.http.HttpPipeline;
import com.azure.resourcemanager.resources.fluent.ChangesManagementClient;
import com.azure.resourcemanager.resources.fluent.DataBoundariesManagementClient;
import com.azure.resourcemanager.resources.fluent.DeploymentStacksManagementClient;
import com.azure.resourcemanager.resources.fluent.FeatureClient;
import com.azure.resourcemanager.resources.fluent.ManagementLockClient;
import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl;
import com.azure.resourcemanager.resources.fluentcore.policy.ProviderRegistrationPolicy;
import com.azure.resourcemanager.resources.implementation.ChangesManagementClientBuilder;
import com.azure.resourcemanager.resources.implementation.DataBoundariesManagementClientBuilder;
import com.azure.resourcemanager.resources.implementation.DeploymentStacksManagementClientBuilder;
import com.azure.resourcemanager.resources.implementation.FeatureClientBuilder;
import com.azure.resourcemanager.resources.fluent.PolicyClient;
Expand Down Expand Up @@ -62,6 +64,7 @@ public final class ResourceManager extends Manager<ResourceManagementClient> {
private final ManagementLockClient managementLockClient;
private final ChangesManagementClient resourceChangeClient;
private final DeploymentStacksManagementClient deploymentStackClient;
private final DataBoundariesManagementClient dataBoundaryClient;
// The collections
private ResourceGroups resourceGroups;
private GenericResources genericResources;
Expand Down Expand Up @@ -264,6 +267,11 @@ private ResourceManager(HttpPipeline httpPipeline, AzureProfile profile) {
.subscriptionId(profile.getSubscriptionId())
.buildClient();

this.dataBoundaryClient = new DataBoundariesManagementClientBuilder()
.pipeline(httpPipeline)
.endpoint(profile.getEnvironment().getResourceManagerEndpoint())
.buildClient();

for (int i = 0; i < httpPipeline.getPolicyCount(); ++i) {
if (httpPipeline.getPolicy(i) instanceof ProviderRegistrationPolicy) {
ProviderRegistrationPolicy policy = (ProviderRegistrationPolicy) httpPipeline.getPolicy(i);
Expand Down Expand Up @@ -324,6 +332,16 @@ public DeploymentStacksManagementClient deploymentStackClient() {
return deploymentStackClient;
}

/**
* Wrapped inner data boundary client providing direct access to auto-generated API implementation,
* based on Azure REST API.
*
* @return wrapped inner data boundary client.
*/
public DataBoundariesManagementClient dataBoundaryClient() {
return dataBoundaryClient;
}

/**
* @return the resource group management API entry point
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.resources.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
import com.azure.resourcemanager.resources.fluent.models.DataBoundaryDefinitionInner;
import com.azure.resourcemanager.resources.models.DefaultName;
import reactor.core.publisher.Mono;

/**
* An instance of this class provides access to all the operations defined in DataBoundariesClient.
*/
public interface DataBoundariesClient {
/**
* Opt-in tenant to data boundary.
*
* @param defaultParameter Default string modeled as parameter for auto generation to work correctly.
* @param dataBoundaryDefinition The data boundary to opt the tenant to.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a data boundary definition along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<Response<DataBoundaryDefinitionInner>> putWithResponseAsync(DefaultName defaultParameter,
DataBoundaryDefinitionInner dataBoundaryDefinition);

/**
* Opt-in tenant to data boundary.
*
* @param defaultParameter Default string modeled as parameter for auto generation to work correctly.
* @param dataBoundaryDefinition The data boundary to opt the tenant to.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a data boundary definition on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<DataBoundaryDefinitionInner> putAsync(DefaultName defaultParameter,
DataBoundaryDefinitionInner dataBoundaryDefinition);

/**
* Opt-in tenant to data boundary.
*
* @param defaultParameter Default string modeled as parameter for auto generation to work correctly.
* @param dataBoundaryDefinition The data boundary to opt the tenant to.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a data boundary definition along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<DataBoundaryDefinitionInner> putWithResponse(DefaultName defaultParameter,
DataBoundaryDefinitionInner dataBoundaryDefinition, Context context);

/**
* Opt-in tenant to data boundary.
*
* @param defaultParameter Default string modeled as parameter for auto generation to work correctly.
* @param dataBoundaryDefinition The data boundary to opt the tenant to.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a data boundary definition.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
DataBoundaryDefinitionInner put(DefaultName defaultParameter, DataBoundaryDefinitionInner dataBoundaryDefinition);

/**
* Get data boundary of tenant.
*
* @param defaultParameter Default string modeled as parameter for auto generation to work correctly.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return data boundary of tenant along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<Response<DataBoundaryDefinitionInner>> getTenantWithResponseAsync(DefaultName defaultParameter);

/**
* Get data boundary of tenant.
*
* @param defaultParameter Default string modeled as parameter for auto generation to work correctly.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return data boundary of tenant on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<DataBoundaryDefinitionInner> getTenantAsync(DefaultName defaultParameter);

/**
* Get data boundary of tenant.
*
* @param defaultParameter Default string modeled as parameter for auto generation to work correctly.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return data boundary of tenant along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<DataBoundaryDefinitionInner> getTenantWithResponse(DefaultName defaultParameter, Context context);

/**
* Get data boundary of tenant.
*
* @param defaultParameter Default string modeled as parameter for auto generation to work correctly.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return data boundary of tenant.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
DataBoundaryDefinitionInner getTenant(DefaultName defaultParameter);

/**
* Get data boundary at specified scope.
*
* @param scope The scope at which the operation is performed.
* @param defaultParameter Default string modeled as parameter for auto generation to work correctly.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return data boundary at specified scope along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<Response<DataBoundaryDefinitionInner>> getScopeWithResponseAsync(String scope, DefaultName defaultParameter);

/**
* Get data boundary at specified scope.
*
* @param scope The scope at which the operation is performed.
* @param defaultParameter Default string modeled as parameter for auto generation to work correctly.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return data boundary at specified scope on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<DataBoundaryDefinitionInner> getScopeAsync(String scope, DefaultName defaultParameter);

/**
* Get data boundary at specified scope.
*
* @param scope The scope at which the operation is performed.
* @param defaultParameter Default string modeled as parameter for auto generation to work correctly.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return data boundary at specified scope along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<DataBoundaryDefinitionInner> getScopeWithResponse(String scope, DefaultName defaultParameter,
Context context);

/**
* Get data boundary at specified scope.
*
* @param scope The scope at which the operation is performed.
* @param defaultParameter Default string modeled as parameter for auto generation to work correctly.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return data boundary at specified scope.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
DataBoundaryDefinitionInner getScope(String scope, DefaultName defaultParameter);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.resources.fluent;

import com.azure.core.http.HttpPipeline;
import java.time.Duration;

/**
* The interface for DataBoundariesManagementClient class.
*/
public interface DataBoundariesManagementClient {
/**
* Gets server parameter.
*
* @return the endpoint value.
*/
String getEndpoint();

/**
* Gets Api Version.
*
* @return the apiVersion value.
*/
String getApiVersion();

/**
* Gets The HTTP pipeline to send requests through.
*
* @return the httpPipeline value.
*/
HttpPipeline getHttpPipeline();

/**
* Gets The default poll interval for long-running operation.
*
* @return the defaultPollInterval value.
*/
Duration getDefaultPollInterval();

/**
* Gets the DataBoundariesClient object to access its operations.
*
* @return the DataBoundariesClient object.
*/
DataBoundariesClient getDataBoundaries();
}
Loading

0 comments on commit d2dbba0

Please sign in to comment.