def create_remote_oio(io_url: str, object_url: str, object_type: str = "zaak") -> dict: if settings.CMIS_ENABLED: if object_type == "zaak": oio = ObjectInformatieObject.objects.create( informatieobject=io_url, zaak=object_url, object_type=object_type) elif object_type == "besluit": oio = ObjectInformatieObject.objects.create( informatieobject=io_url, besluit=object_url, object_type=object_type) response = {"url": oio.get_url()} else: client = Service.get_client(io_url) if client is None: raise UnknownService( f"{io_url} API should be added to Service model") body = { "informatieobject": io_url, "object": object_url, "objectType": object_type, } response = client.create("objectinformatieobject", data=body) return response
def delete_remote_zaakbesluit(zaakbesluit_url: str) -> None: client = Service.get_client(zaakbesluit_url) if client is None: raise UnknownService( f"{zaakbesluit_url} API should be added to Service model") client.delete("zaakbesluit", zaakbesluit_url)
def create_remote_oio(io_url: str, object_url: str, object_type: str = "zaak") -> dict: client = Service.get_client(io_url) if client is None: raise UnknownService(f"{io_url} API should be added to Service model") body = {"informatieobject": io_url, "object": object_url, "objectType": object_type} response = client.create("objectinformatieobject", data=body) return response
def fetch_object(resource: str, url: str) -> dict: """ Fetch a remote object by URL. """ client = Service.get_client(url) if not client: raise UnknownService(f"{url} API should be added to Service model") obj = client.retrieve(resource, url=url) return obj
def create_remote_zaakbesluit(besluit_url: str, zaak_url: str) -> dict: client = Service.get_client(zaak_url) if client is None: raise UnknownService(f"{zaak_url} API should be added to Service model") zaak_uuid = get_uuid_from_path(zaak_url) body = {"besluit": besluit_url} response = client.create("zaakbesluit", data=body, zaak_uuid=zaak_uuid) return response
def delete_remote_oio(oio_url: str) -> None: client = Service.get_client(oio_url) if client is None: raise UnknownService(f"{oio_url} API should be added to Service model") client.delete("objectinformatieobject", oio_url)