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 authorization/resource-manager] Removed "x-ms-pageable" from the elevateAccess API #2913

Merged
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* 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.authorization.v2015_07_01;

import rx.Completable;
import com.microsoft.azure.management.authorization.v2015_07_01.implementation.ElevateAccessInner;
import com.microsoft.azure.arm.model.HasInner;

/**
* Type representing ElevateAccess.
*/
public interface ElevateAccess extends HasInner<ElevateAccessInner> {
/**
* Elevates access for a Global Administrator.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Completable postAsync();

}
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,19 @@ public RoleDefinitionsInner roleDefinitions() {
return this.roleDefinitions;
}

/**
* The ElevateAccessInner object to access its operations.
*/
private ElevateAccessInner elevateAccess;

/**
* Gets the ElevateAccessInner object to access its operations.
* @return the ElevateAccessInner object.
*/
public ElevateAccessInner elevateAccess() {
return this.elevateAccess;
}

/**
* The ClassicAdministratorsInner object to access its operations.
*/
Expand Down Expand Up @@ -236,6 +249,7 @@ protected void initialize() {
this.providerOperationsMetadatas = new ProviderOperationsMetadatasInner(restClient().retrofit(), this);
this.roleAssignments = new RoleAssignmentsInner(restClient().retrofit(), this);
this.roleDefinitions = new RoleDefinitionsInner(restClient().retrofit(), this);
this.elevateAccess = new ElevateAccessInner(restClient().retrofit(), this);
this.classicAdministrators = new ClassicAdministratorsInner(restClient().retrofit(), this);
this.azureClient = new AzureClient(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.microsoft.azure.management.authorization.v2015_07_01.ProviderOperationsMetadatas;
import com.microsoft.azure.management.authorization.v2015_07_01.RoleAssignments;
import com.microsoft.azure.management.authorization.v2015_07_01.RoleDefinitions;
import com.microsoft.azure.management.authorization.v2015_07_01.ElevateAccess;
import com.microsoft.azure.management.authorization.v2015_07_01.ClassicAdministrators;
import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl;
import com.microsoft.azure.arm.resources.implementation.ManagerCore;
Expand All @@ -32,6 +33,7 @@ public final class AuthorizationManager extends ManagerCore<AuthorizationManager
private ProviderOperationsMetadatas providerOperationsMetadatas;
private RoleAssignments roleAssignments;
private RoleDefinitions roleDefinitions;
private ElevateAccess elevateAccess;
private ClassicAdministrators classicAdministrators;
/**
* Get a Configurable instance that can be used to create AuthorizationManager with optional configuration.
Expand Down Expand Up @@ -120,6 +122,16 @@ public RoleDefinitions roleDefinitions() {
return this.roleDefinitions;
}

/**
* @return Entry point to manage ElevateAccess.
*/
public ElevateAccess elevateAccess() {
if (this.elevateAccess == null) {
this.elevateAccess = new ElevateAccessImpl(this);
}
return this.elevateAccess;
}

/**
* @return Entry point to manage ClassicAdministrators.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* 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.
* abc
*/

package com.microsoft.azure.management.authorization.v2015_07_01.implementation;

import com.microsoft.azure.arm.model.implementation.WrapperImpl;
import com.microsoft.azure.management.authorization.v2015_07_01.ElevateAccess;
import rx.Completable;

class ElevateAccessImpl extends WrapperImpl<ElevateAccessInner> implements ElevateAccess {
private final AuthorizationManager manager;

ElevateAccessImpl(AuthorizationManager manager) {
super(manager.inner().elevateAccess());
this.manager = manager;
}

public AuthorizationManager manager() {
return this.manager;
}

@Override
public Completable postAsync() {
ElevateAccessInner client = this.inner();
return client.postAsync().toCompletable();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/**
* 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.authorization.v2015_07_01.implementation;

import retrofit2.Retrofit;
import com.google.common.reflect.TypeToken;
import com.microsoft.azure.CloudException;
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.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
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 ElevateAccess.
*/
public class ElevateAccessInner {
/** The Retrofit service to perform REST calls. */
private ElevateAccessService service;
/** The service client containing this operation class. */
private AuthorizationManagementClientImpl client;

/**
* Initializes an instance of ElevateAccessInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public ElevateAccessInner(Retrofit retrofit, AuthorizationManagementClientImpl client) {
this.service = retrofit.create(ElevateAccessService.class);
this.client = client;
}

/**
* The interface defining all the services for ElevateAccess to be
* used by Retrofit to perform actually REST calls.
*/
interface ElevateAccessService {
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2015_07_01.ElevateAccess post" })
@POST("providers/Microsoft.Authorization/elevateAccess")
Observable<Response<ResponseBody>> post(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

}

/**
* Elevates access for a Global Administrator.
*
* @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 post() {
postWithServiceResponseAsync().toBlocking().single().body();
}

/**
* Elevates access for a Global Administrator.
*
* @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> postAsync(final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(postWithServiceResponseAsync(), serviceCallback);
}

/**
* Elevates access for a Global Administrator.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> postAsync() {
return postWithServiceResponseAsync().map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}

/**
* Elevates access for a Global Administrator.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> postWithServiceResponseAsync() {
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.post(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 = postDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}

private ServiceResponse<Void> postDelegate(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);
}

}