diff --git a/azure-graphrbac/src/main/java/com/microsoft/azure/graphrbac/implementation/OAuth2sInner.java b/azure-graphrbac/src/main/java/com/microsoft/azure/graphrbac/implementation/OAuth2sInner.java index 78dcc195e9cc..9254affa50dd 100644 --- a/azure-graphrbac/src/main/java/com/microsoft/azure/graphrbac/implementation/OAuth2sInner.java +++ b/azure-graphrbac/src/main/java/com/microsoft/azure/graphrbac/implementation/OAuth2sInner.java @@ -58,9 +58,9 @@ interface OAuth2sService { @GET("{tenantID}/oauth2PermissionGrants") Observable> get(@Path("tenantID") String tenantID, @Query("$filter") String filter, @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.graphrbac.OAuth2s post" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.graphrbac.OAuth2s grant" }) @POST("{tenantID}/oauth2PermissionGrants") - Observable> post(@Path("tenantID") String tenantID, @Body PermissionsInner body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> grant(@Path("tenantID") String tenantID, @Body PermissionsInner body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } @@ -214,8 +214,8 @@ private ServiceResponse getDelegate(Response res * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PermissionsInner object if successful. */ - public PermissionsInner post() { - return postWithServiceResponseAsync().toBlocking().single().body(); + public PermissionsInner grant() { + return grantWithServiceResponseAsync().toBlocking().single().body(); } /** @@ -225,8 +225,8 @@ public PermissionsInner post() { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture postAsync(final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(postWithServiceResponseAsync(), serviceCallback); + public ServiceFuture grantAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(grantWithServiceResponseAsync(), serviceCallback); } /** @@ -235,8 +235,8 @@ public ServiceFuture postAsync(final ServiceCallback postAsync() { - return postWithServiceResponseAsync().map(new Func1, PermissionsInner>() { + public Observable grantAsync() { + return grantWithServiceResponseAsync().map(new Func1, PermissionsInner>() { @Override public PermissionsInner call(ServiceResponse response) { return response.body(); @@ -250,7 +250,7 @@ public PermissionsInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PermissionsInner object */ - public Observable> postWithServiceResponseAsync() { + public Observable> grantWithServiceResponseAsync() { if (this.client.tenantID() == null) { throw new IllegalArgumentException("Parameter this.client.tenantID() is required and cannot be null."); } @@ -258,12 +258,12 @@ public Observable> postWithServiceResponseAsyn throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } final PermissionsInner body = null; - return service.post(this.client.tenantID(), body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.grant(this.client.tenantID(), body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = postDelegate(response); + ServiceResponse clientResponse = grantDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -281,8 +281,8 @@ public Observable> call(Response * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PermissionsInner object if successful. */ - public PermissionsInner post(PermissionsInner body) { - return postWithServiceResponseAsync(body).toBlocking().single().body(); + public PermissionsInner grant(PermissionsInner body) { + return grantWithServiceResponseAsync(body).toBlocking().single().body(); } /** @@ -293,8 +293,8 @@ public PermissionsInner post(PermissionsInner body) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture postAsync(PermissionsInner body, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(postWithServiceResponseAsync(body), serviceCallback); + public ServiceFuture grantAsync(PermissionsInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(grantWithServiceResponseAsync(body), serviceCallback); } /** @@ -304,8 +304,8 @@ public ServiceFuture postAsync(PermissionsInner body, final Se * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PermissionsInner object */ - public Observable postAsync(PermissionsInner body) { - return postWithServiceResponseAsync(body).map(new Func1, PermissionsInner>() { + public Observable grantAsync(PermissionsInner body) { + return grantWithServiceResponseAsync(body).map(new Func1, PermissionsInner>() { @Override public PermissionsInner call(ServiceResponse response) { return response.body(); @@ -320,7 +320,7 @@ public PermissionsInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PermissionsInner object */ - public Observable> postWithServiceResponseAsync(PermissionsInner body) { + public Observable> grantWithServiceResponseAsync(PermissionsInner body) { if (this.client.tenantID() == null) { throw new IllegalArgumentException("Parameter this.client.tenantID() is required and cannot be null."); } @@ -328,12 +328,12 @@ public Observable> postWithServiceResponseAsyn throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Validator.validate(body); - return service.post(this.client.tenantID(), body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.grant(this.client.tenantID(), body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = postDelegate(response); + ServiceResponse clientResponse = grantDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -342,7 +342,7 @@ public Observable> call(Response }); } - private ServiceResponse postDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse grantDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(201, new TypeToken() { }.getType()) .registerError(CloudException.class)