Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR sdk/resources/mgmt-v2020_06_01] Add Private link and Private link association APIs #5253

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 2 additions & 2 deletions sdk/resources/mgmt-v2020_06_01/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-arm-parent</artifactId>
<version>1.3.2</version>
<relativePath>../../parents/azure-arm-parent/pom.xml</relativePath>
<version>1.1.0</version>
<relativePath>../../../pom.management.xml</relativePath>
</parent>
<artifactId>azure-mgmt-resources</artifactId>
<version>1.0.0-beta</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ public class DeploymentProperties {
@JsonProperty(value = "onErrorDeployment")
private OnErrorDeployment onErrorDeployment;

/**
* Specifies whether template expressions are evaluated within the scope of
* the parent template or nested template. Only applicable to nested
* templates. If not specified, default value is outer.
*/
@JsonProperty(value = "expressionEvaluationOptions")
private ExpressionEvaluationOptions expressionEvaluationOptions;

/**
* Get the template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both.
*
Expand Down Expand Up @@ -213,4 +221,24 @@ public DeploymentProperties withOnErrorDeployment(OnErrorDeployment onErrorDeplo
return this;
}

/**
* Get specifies whether template expressions are evaluated within the scope of the parent template or nested template. Only applicable to nested templates. If not specified, default value is outer.
*
* @return the expressionEvaluationOptions value
*/
public ExpressionEvaluationOptions expressionEvaluationOptions() {
return this.expressionEvaluationOptions;
}

/**
* Set specifies whether template expressions are evaluated within the scope of the parent template or nested template. Only applicable to nested templates. If not specified, default value is outer.
*
* @param expressionEvaluationOptions the expressionEvaluationOptions value to set
* @return the DeploymentProperties object itself.
*/
public DeploymentProperties withExpressionEvaluationOptions(ExpressionEvaluationOptions expressionEvaluationOptions) {
this.expressionEvaluationOptions = expressionEvaluationOptions;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -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.resources.v2020_06_01;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Specifies whether template expressions are evaluated within the scope of the
* parent template or nested template.
*/
public class ExpressionEvaluationOptions {
/**
* The scope to be used for evaluation of parameters, variables and
* functions in a nested template. Possible values include: 'NotSpecified',
* 'Outer', 'Inner'.
*/
@JsonProperty(value = "scope")
private ExpressionEvaluationOptionsScopeType scope;

/**
* Get the scope to be used for evaluation of parameters, variables and functions in a nested template. Possible values include: 'NotSpecified', 'Outer', 'Inner'.
*
* @return the scope value
*/
public ExpressionEvaluationOptionsScopeType scope() {
return this.scope;
}

/**
* Set the scope to be used for evaluation of parameters, variables and functions in a nested template. Possible values include: 'NotSpecified', 'Outer', 'Inner'.
*
* @param scope the scope value to set
* @return the ExpressionEvaluationOptions object itself.
*/
public ExpressionEvaluationOptions withScope(ExpressionEvaluationOptionsScopeType scope) {
this.scope = scope;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -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.resources.v2020_06_01;

import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;

/**
* Defines values for ExpressionEvaluationOptionsScopeType.
*/
public final class ExpressionEvaluationOptionsScopeType extends ExpandableStringEnum<ExpressionEvaluationOptionsScopeType> {
/** Static value NotSpecified for ExpressionEvaluationOptionsScopeType. */
public static final ExpressionEvaluationOptionsScopeType NOT_SPECIFIED = fromString("NotSpecified");

/** Static value Outer for ExpressionEvaluationOptionsScopeType. */
public static final ExpressionEvaluationOptionsScopeType OUTER = fromString("Outer");

/** Static value Inner for ExpressionEvaluationOptionsScopeType. */
public static final ExpressionEvaluationOptionsScopeType INNER = fromString("Inner");

/**
* Creates or finds a ExpressionEvaluationOptionsScopeType from its string representation.
* @param name a name to look for
* @return the corresponding ExpressionEvaluationOptionsScopeType
*/
@JsonCreator
public static ExpressionEvaluationOptionsScopeType fromString(String name) {
return fromString(name, ExpressionEvaluationOptionsScopeType.class);
}

/**
* @return known ExpressionEvaluationOptionsScopeType values
*/
public static Collection<ExpressionEvaluationOptionsScopeType> values() {
return values(ExpressionEvaluationOptionsScopeType.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package com.microsoft.azure.management.resources.v2020_06_01;

import rx.Observable;
import rx.Completable;
import com.microsoft.azure.management.resources.v2020_06_01.implementation.ProvidersInner;
import com.microsoft.azure.arm.model.HasInner;

Expand All @@ -25,6 +26,16 @@ public interface Providers extends HasInner<ProvidersInner> {
*/
Observable<Provider> unregisterAsync(String resourceProviderNamespace);

/**
* Registers a management group with a resource provider.
*
* @param resourceProviderNamespace The namespace of the resource provider to register.
* @param groupId The management group ID.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Completable registerAtManagementGroupScopeAsync(String resourceProviderNamespace, String groupId);

/**
* Registers a subscription with a resource provider.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import rx.Observable;
import rx.functions.Func1;
import com.microsoft.azure.Page;
import rx.Completable;
import com.microsoft.azure.management.resources.v2020_06_01.Provider;

class ProvidersImpl extends WrapperImpl<ProvidersInner> implements Providers {
Expand Down Expand Up @@ -44,6 +45,12 @@ public Provider call(ProviderInner inner) {
});
}

@Override
public Completable registerAtManagementGroupScopeAsync(String resourceProviderNamespace, String groupId) {
ProvidersInner client = this.inner();
return client.registerAtManagementGroupScopeAsync(resourceProviderNamespace, groupId).toCompletable();
}

@Override
public Observable<Provider> registerAsync(String resourceProviderNamespace) {
ProvidersInner client = this.inner();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ interface ProvidersService {
@POST("subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister")
Observable<Response<ResponseBody>> unregister(@Path("resourceProviderNamespace") String resourceProviderNamespace, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.v2020_06_01.Providers registerAtManagementGroupScope" })
@POST("providers/Microsoft.Management/managementGroups/{groupId}/providers/{resourceProviderNamespace}/register")
Observable<Response<ResponseBody>> registerAtManagementGroupScope(@Path("resourceProviderNamespace") String resourceProviderNamespace, @Path("groupId") String groupId, @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.resources.v2020_06_01.Providers register" })
@POST("subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register")
Observable<Response<ResponseBody>> register(@Path("resourceProviderNamespace") String resourceProviderNamespace, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
Expand Down Expand Up @@ -171,6 +175,88 @@ private ServiceResponse<ProviderInner> unregisterDelegate(Response<ResponseBody>
.build(response);
}

/**
* Registers a management group with a resource provider.
*
* @param resourceProviderNamespace The namespace of the resource provider to register.
* @param groupId The management group ID.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
public void registerAtManagementGroupScope(String resourceProviderNamespace, String groupId) {
registerAtManagementGroupScopeWithServiceResponseAsync(resourceProviderNamespace, groupId).toBlocking().single().body();
}

/**
* Registers a management group with a resource provider.
*
* @param resourceProviderNamespace The namespace of the resource provider to register.
* @param groupId The management group ID.
* @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<Void> registerAtManagementGroupScopeAsync(String resourceProviderNamespace, String groupId, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(registerAtManagementGroupScopeWithServiceResponseAsync(resourceProviderNamespace, groupId), serviceCallback);
}

/**
* Registers a management group with a resource provider.
*
* @param resourceProviderNamespace The namespace of the resource provider to register.
* @param groupId The management group ID.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> registerAtManagementGroupScopeAsync(String resourceProviderNamespace, String groupId) {
return registerAtManagementGroupScopeWithServiceResponseAsync(resourceProviderNamespace, groupId).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}

/**
* Registers a management group with a resource provider.
*
* @param resourceProviderNamespace The namespace of the resource provider to register.
* @param groupId The management group ID.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> registerAtManagementGroupScopeWithServiceResponseAsync(String resourceProviderNamespace, String groupId) {
if (resourceProviderNamespace == null) {
throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.");
}
if (groupId == null) {
throw new IllegalArgumentException("Parameter groupId 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.registerAtManagementGroupScope(resourceProviderNamespace, groupId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Void> clientResponse = registerAtManagementGroupScopeDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}

private ServiceResponse<Void> registerAtManagementGroupScopeDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}

/**
* Registers a subscription with a resource provider.
*
Expand Down