use of com.microsoft.azure.management.graphrbac.RoleAssignmentCreateParameters in project azure-sdk-for-java by Azure.
the class RoleAssignmentsInner method createByIdWithServiceResponseAsync.
/**
* Creates a role assignment by ID.
*
* @param roleAssignmentId The ID of the role assignment to create.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the RoleAssignmentInner object
*/
public Observable<ServiceResponse<RoleAssignmentInner>> createByIdWithServiceResponseAsync(String roleAssignmentId) {
if (roleAssignmentId == null) {
throw new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
final RoleAssignmentPropertiesInner properties = null;
RoleAssignmentCreateParameters parameters = new RoleAssignmentCreateParameters();
parameters.withProperties(null);
return service.createById(roleAssignmentId, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<RoleAssignmentInner>>>() {
@Override
public Observable<ServiceResponse<RoleAssignmentInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<RoleAssignmentInner> clientResponse = createByIdDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
use of com.microsoft.azure.management.graphrbac.RoleAssignmentCreateParameters in project azure-sdk-for-java by Azure.
the class RoleAssignmentsInner method createWithServiceResponseAsync.
/**
* Creates a role assignment.
*
* @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.
* @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the RoleAssignmentInner object
*/
public Observable<ServiceResponse<RoleAssignmentInner>> createWithServiceResponseAsync(String scope, String roleAssignmentName) {
if (scope == null) {
throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
}
if (roleAssignmentName == null) {
throw new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
final RoleAssignmentPropertiesInner properties = null;
RoleAssignmentCreateParameters parameters = new RoleAssignmentCreateParameters();
parameters.withProperties(null);
return service.create(scope, roleAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<RoleAssignmentInner>>>() {
@Override
public Observable<ServiceResponse<RoleAssignmentInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<RoleAssignmentInner> clientResponse = createDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
use of com.microsoft.azure.management.graphrbac.RoleAssignmentCreateParameters in project azure-sdk-for-java by Azure.
the class RoleAssignmentsInner method createWithServiceResponseAsync.
/**
* Creates a role assignment.
*
* @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.
* @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID.
* @param properties Role assignment properties.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the RoleAssignmentInner object
*/
public Observable<ServiceResponse<RoleAssignmentInner>> createWithServiceResponseAsync(String scope, String roleAssignmentName, RoleAssignmentPropertiesInner properties) {
if (scope == null) {
throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
}
if (roleAssignmentName == null) {
throw new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Validator.validate(properties);
RoleAssignmentCreateParameters parameters = new RoleAssignmentCreateParameters();
parameters.withProperties(properties);
return service.create(scope, roleAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<RoleAssignmentInner>>>() {
@Override
public Observable<ServiceResponse<RoleAssignmentInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<RoleAssignmentInner> clientResponse = createDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
use of com.microsoft.azure.management.graphrbac.RoleAssignmentCreateParameters in project azure-sdk-for-java by Azure.
the class RoleAssignmentsInner method createByIdWithServiceResponseAsync.
/**
* Creates a role assignment by ID.
*
* @param roleAssignmentId The ID of the role assignment to create.
* @param properties Role assignment properties.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the RoleAssignmentInner object
*/
public Observable<ServiceResponse<RoleAssignmentInner>> createByIdWithServiceResponseAsync(String roleAssignmentId, RoleAssignmentPropertiesInner properties) {
if (roleAssignmentId == null) {
throw new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Validator.validate(properties);
RoleAssignmentCreateParameters parameters = new RoleAssignmentCreateParameters();
parameters.withProperties(properties);
return service.createById(roleAssignmentId, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<RoleAssignmentInner>>>() {
@Override
public Observable<ServiceResponse<RoleAssignmentInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<RoleAssignmentInner> clientResponse = createByIdDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Aggregations