def METHOD_NAME(self):
    protocol = flask.request.form.get("protocol")
    is_new = False
    error = self.validate_form_fields(protocol)
    if error:
        return error
    id = flask.request.form.get("id")
    if id:
        # Find an existing service to edit
        service = get_one(self._db, ExternalIntegration, id=id, goal=ExternalIntegration.CATALOG_GOAL)
        if not service:
            return MISSING_SERVICE
        if protocol != service.protocol:
            return CANNOT_CHANGE_PROTOCOL
    else:
        # Create a new service
        service, is_new = self._create_integration(
            self.protocols, protocol, ExternalIntegration.CATALOG_GOAL,
        )
        if isinstance(service, ProblemDetail):
            return service
    name = self.get_name(service)
    if isinstance(name, ProblemDetail):
        self._db.rollback()
        return name
    elif name:
        service.name = name
    [protocol] = [p for p in self.protocols if p.get("name") == protocol]
    result = self._set_integration_settings_and_libraries(service, protocol)
    if isinstance(result, ProblemDetail):
        return result
    external_integration_link = self._set_external_integration_link(service)
    if isinstance(external_integration_link, ProblemDetail):
        return external_integration_link
    library_error = self.check_libraries(service)
    if library_error:
        self._db.rollback()
        return library_error
    if is_new:
        return Response(str(service.id), 201)
    else:
        return Response(str(service.id), 200)