def request_role(self, org_id='', user_id='', role_name=''):
        """Requests for an role within an Org which must be accepted or denied as a separate process.
        A role of Member is automatically implied with successfull enrollment.  Throws a
        NotFound exception if neither id is found.

        @param org_id    str
        @param user_id    str
        @param role_name    str
        @retval request_id    str
        @throws NotFound    object with specified id does not exist
        """

        param_objects = self._validate_parameters(org_id=org_id,
                                                  user_id=user_id,
                                                  role_name=role_name)

        if role_name == MEMBER_ROLE:
            raise BadRequest(
                "The Member User Role is already assigned with an enrollment to an Org"
            )

        #Initiate request
        req_obj = NegotiateRequestFactory.create_role_request(
            org_id, user_id, role_name)

        req_id = self.request_handler.open_request(req_obj)

        return req_id
    def request_enroll(self, org_id='', user_id=''):
        """Requests for an enrollment with an Org which must be accepted or denied as a separate process.
        Membership in the ION Org is implied by registration with the system, so a membership
        association to the ION Org is not maintained. Throws a NotFound exception if neither id is found.

        @param org_id    str
        @param user_id    str
        @retval request_id    str
        @throws NotFound    object with specified id does not exist
        """

        param_objects = self._validate_parameters(org_id=org_id,
                                                  user_id=user_id)
        org = param_objects['org']

        if org.name == ROOT_ION_ORG_NAME:
            raise BadRequest(
                "A request to enroll in the root ION Org is not allowed")

        #Initiate request
        req_obj = NegotiateRequestFactory.create_enrollment_request(
            org_id, user_id)

        req_id = self.request_handler.open_request(req_obj)

        return req_id
    def request_acquire_resource(self, org_id='', user_id='', resource_id=''):
        """Requests to acquire a resource within an Org which must be accepted or denied as a separate process.
        Throws a NotFound exception if neither id is found.

        @param org_id    str
        @param user_id    str
        @param resource_id    str
        @retval request_id    str
        @throws NotFound    object with specified id does not exist
        """
        param_objects = self._validate_parameters(org_id=org_id, user_id=user_id, resource_id=resource_id)

        #Initiate request
        req_obj = NegotiateRequestFactory.create_acquire_resource(org_id, user_id, resource_id)

        req_id = self.request_handler.open_request(req_obj)

        return req_id
    def request_acquire_resource(self, org_id='', user_id='', resource_id=''):
        """Requests to acquire a resource within an Org which must be accepted or denied as a separate process.
        Throws a NotFound exception if neither id is found.

        @param org_id    str
        @param user_id    str
        @param resource_id    str
        @retval request_id    str
        @throws NotFound    object with specified id does not exist
        """
        param_objects = self._validate_parameters(org_id=org_id,
                                                  user_id=user_id,
                                                  resource_id=resource_id)

        #Initiate request
        req_obj = NegotiateRequestFactory.create_acquire_resource(
            org_id, user_id, resource_id)

        req_id = self.request_handler.open_request(req_obj)

        return req_id
    def request_role(self, org_id='', user_id='', role_name=''):
        """Requests for an role within an Org which must be accepted or denied as a separate process.
        A role of Member is automatically implied with successfull enrollment.  Throws a
        NotFound exception if neither id is found.

        @param org_id    str
        @param user_id    str
        @param role_name    str
        @retval request_id    str
        @throws NotFound    object with specified id does not exist
        """

        param_objects = self._validate_parameters(org_id=org_id, user_id=user_id, role_name=role_name)

        if role_name == MEMBER_ROLE:
            raise BadRequest("The Member User Role is already assigned with an enrollment to an Org")

        #Initiate request
        req_obj = NegotiateRequestFactory.create_role_request(org_id, user_id, role_name)

        req_id = self.request_handler.open_request(req_obj)

        return req_id
    def request_enroll(self, org_id='', user_id=''):
        """Requests for an enrollment with an Org which must be accepted or denied as a separate process.
        Membership in the ION Org is implied by registration with the system, so a membership
        association to the ION Org is not maintained. Throws a NotFound exception if neither id is found.

        @param org_id    str
        @param user_id    str
        @retval request_id    str
        @throws NotFound    object with specified id does not exist
        """

        param_objects = self._validate_parameters(org_id=org_id, user_id=user_id)
        org = param_objects['org']

        if org.name == ROOT_ION_ORG_NAME:
            raise BadRequest("A request to enroll in the root ION Org is not allowed")

        #Initiate request
        req_obj = NegotiateRequestFactory.create_enrollment_request(org_id, user_id)

        req_id = self.request_handler.open_request(req_obj)

        return req_id