Skip to main content

Library for creating Functions for CIM Database Cloud.

Project description

CONTACT Logo Functions-Library

This library is used for creating Functions for CIM Database Cloud.

Installation

$ pip install contactsoftware-functions

Example usage

from cs.functions import MetaData, WorkloadResponse, Service
from cs.functions.event import DocumentReleaseEvent
from cs.functions.action import AbortAndShowErrorAction


def my_function(metadata: MetaData, event: DocumentReleaseEvent, service: Service):
    number = service.generator.get_number("error_counter")
    message = f"Document {event.data.documents[0].z_nummer} can't be released by {metadata.app_user}! Attempt: {number}"
    return WorkloadResponse(
        event_id=event.event_id,
        actions=[AbortAndShowErrorAction(id="123", message=message)],
    )

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

contactsoftware_functions-0.5.0.tar.gz (13.3 kB view hashes)

Uploaded Source

Built Distribution

contactsoftware_functions-0.5.0-py3-none-any.whl (23.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page