Skip to main content

Digital.ai Release API Stubs

Project description

Digital.ai Release Python API Stubs

The Digital.ai Release Python API Stubs (digitalai-release-api-stubs) provide Python stubs for interacting with the Digital.ai Release REST API.
These stubs are generated using the OpenAPI Generator.

Note: Previously, these stubs were included as part of the digitalai-release-sdk version 24.1.0. They are now distributed as a separate package.

⚠️ WARNING:
This project generates stubs for the Digital.ai Release 23.3.0 API and is no longer being maintained.

📦 Installation

Install the package using pip:

pip install digitalai-release-api-stubs

🚀 Getting Started

Example Task: message.py

The example below demonstrates how to create a simple task that sets a system message in the Release UI using the API stubs.

from digitalai.release.integration import BaseTask
from digitalai.release.v1.api_client import ApiClient
from digitalai.release.v1.configuration import Configuration
from digitalai.release.v1.api.configuration_api import ConfigurationApi
from digitalai.release.v1.model.system_message_settings import SystemMessageSettings


class SetSystemMessage(BaseTask):
    """
        Sets the system message in the Release UI by invoking the API.
        Preconditions:
            - The 'Run as user' property must be set on the release.
            - The executing user should have valid credentials.
    """

    def execute(self) -> None:
        # Get the message from the input properties
        message = self.input_properties['message']

        # Create a configuration object
        configuration = Configuration(
            host=self.get_release_server_url(),
            username=self.get_task_user().username,
            password=self.get_task_user().password)

        # Instantiate the API client using the configuration above
        apiclient = ApiClient(configuration)

        # Create a client for the Configuration API using the API client
        configuration_api = ConfigurationApi(apiclient)

        # Prepare the system message payload with required fields
        system_message = SystemMessageSettings(
            type='xlrelease.SystemMessageSettings',
            id='Configuration/settings/SystemMessageSettings',
            message=message,
            enabled=True,
            automated=False
        )

        # Make the actual rest call to the designated endpoint
        configuration_api.update_system_message(system_message_settings=system_message)

        # Add a line to the comment section in the UI
        self.add_comment(f"System message updated to \"{message}\"")

🔁 Upgrading from digitalai-release-sdk 24.1.0 or 23.3.0 to 25.1.0

With the release of digitalai-release-sdk 25.1.0, the API stubs have been separated into a standalone package.

To upgrade your project, follow these steps:

Step 1: Install the API Stubs Package

You must explicitly install the new API stubs package:

pip install digitalai-release-api-stubs==25.1.0

Or, add it to your requirements.txt as needed.


Step 2: Update Your Code

In previous versions, API clients were created like this:

# Old code (pre-25.1.0)
configuration_api = ConfigurationApi(self.get_default_api_client())

In version 25.1.0, use the following approach:

# New code (25.1.0)

# Create a configuration object
configuration = Configuration(
    host=self.get_release_server_url(),
    username=self.get_task_user().username,
    password=self.get_task_user().password
)

# Instantiate the API client using the configuration
apiclient = ApiClient(configuration)

# Create the Configuration API client
configuration_api = ConfigurationApi(apiclient)

This pattern should be used for all API clients, such as TemplateApi, TaskApi, etc.


🔗 Related Resources

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

digitalai_release_api_stubs-25.1.0b1.tar.gz (151.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

digitalai_release_api_stubs-25.1.0b1-py3-none-any.whl (477.7 kB view details)

Uploaded Python 3

File details

Details for the file digitalai_release_api_stubs-25.1.0b1.tar.gz.

File metadata

File hashes

Hashes for digitalai_release_api_stubs-25.1.0b1.tar.gz
Algorithm Hash digest
SHA256 a4df715f97a19490ae897cd0b42ca835f6c89f53cf75d482b745b16db0bdc848
MD5 59e917e93c31cef423ceb115487abf53
BLAKE2b-256 2c06850a9ad4bcb3d9087d8249806450e2f9b398f4bdc4c219d70e03eb36db7e

See more details on using hashes here.

File details

Details for the file digitalai_release_api_stubs-25.1.0b1-py3-none-any.whl.

File metadata

File hashes

Hashes for digitalai_release_api_stubs-25.1.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 ecbc0d54a5a33d77283e929910ae3286a222b1a08cb69369c45cec9efd352253
MD5 4d42935964222e5c08d92cba374413c8
BLAKE2b-256 fb552e4b800534aea2a96250156934764dade69af3e405775249e80460341e4c

See more details on using hashes here.

Supported by

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