public Observable<ServiceResponse<PolicyDefinitionInner>> createOrUpdateAtManagementGroupWithServiceResponseAsync(String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters) {
        if (policyDefinitionName == null) {
            throw new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.");
        }
        if (managementGroupId == null) {
            throw new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.");
        }
        if (parameters == null) {
            throw new IllegalArgumentException("Parameter parameters 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(parameters);
        return service.createOrUpdateAtManagementGroup(policyDefinitionName, managementGroupId, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<PolicyDefinitionInner>>>() {
                @Override
                public Observable<ServiceResponse<PolicyDefinitionInner>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PolicyDefinitionInner> clientResponse = createOrUpdateAtManagementGroupDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
public Observable < ServiceResponse < PolicyDefinitionInner > > createOrUpdateAtManagementGroupWithServiceResponseAsync ( String policyDefinitionName , String managementGroupId , PolicyDefinitionInner parameters ) { if ( policyDefinitionName == null ) { throw new IllegalArgumentException ( "Parameter policyDefinitionName is required and cannot be null." ) ; } if ( managementGroupId == null ) { throw new IllegalArgumentException ( "Parameter managementGroupId is required and cannot be null." ) ; } if ( parameters == null ) { throw new IllegalArgumentException ( "Parameter parameters 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 ( parameters ) ; return service . createOrUpdateAtManagementGroup ( policyDefinitionName , managementGroupId , parameters , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < PolicyDefinitionInner > > > ( ) { @ Override public Observable < ServiceResponse < PolicyDefinitionInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < PolicyDefinitionInner > clientResponse = createOrUpdateAtManagementGroupDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; }
Creates or updates a policy definition at management group level.

@param policyDefinitionName The name of the policy definition to create.
@param managementGroupId The ID of the management group.
@param parameters The policy definition properties.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PolicyDefinitionInner object