Search in sources :

Example 1 with RoleAssignmentCreateParameters

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);
            }
        }
    });
}
Also used : Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) ServiceResponse(com.microsoft.rest.ServiceResponse) RoleAssignmentCreateParameters(com.microsoft.azure.management.graphrbac.RoleAssignmentCreateParameters) Observable(rx.Observable) ResponseBody(okhttp3.ResponseBody)

Example 2 with RoleAssignmentCreateParameters

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);
            }
        }
    });
}
Also used : Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) ServiceResponse(com.microsoft.rest.ServiceResponse) RoleAssignmentCreateParameters(com.microsoft.azure.management.graphrbac.RoleAssignmentCreateParameters) Observable(rx.Observable) ResponseBody(okhttp3.ResponseBody)

Example 3 with RoleAssignmentCreateParameters

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);
            }
        }
    });
}
Also used : Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) ServiceResponse(com.microsoft.rest.ServiceResponse) RoleAssignmentCreateParameters(com.microsoft.azure.management.graphrbac.RoleAssignmentCreateParameters) Observable(rx.Observable) ResponseBody(okhttp3.ResponseBody)

Example 4 with RoleAssignmentCreateParameters

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);
            }
        }
    });
}
Also used : Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) ServiceResponse(com.microsoft.rest.ServiceResponse) RoleAssignmentCreateParameters(com.microsoft.azure.management.graphrbac.RoleAssignmentCreateParameters) Observable(rx.Observable) ResponseBody(okhttp3.ResponseBody)

Aggregations

RoleAssignmentCreateParameters (com.microsoft.azure.management.graphrbac.RoleAssignmentCreateParameters)4 ServiceResponse (com.microsoft.rest.ServiceResponse)4 ResponseBody (okhttp3.ResponseBody)4 Response (retrofit2.Response)4 Observable (rx.Observable)4