Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6816198
added output management
Venkatakrishnan774 May 15, 2026
477e98b
updated workaround
Venkatakrishnan774 May 17, 2026
0e0bdfd
updated workaround
Venkatakrishnan774 May 17, 2026
21ec7d5
updated workaround
Venkatakrishnan774 May 18, 2026
78ce649
updated workaround
Venkatakrishnan774 May 20, 2026
ef83886
adding a logger to test access to this repo
lokeshkumarkuntal May 22, 2026
ad3c8d1
adding a logger to test access to this repo
lokeshkumarkuntal May 22, 2026
b817b56
removed harcoded values
Venkatakrishnan774 Jun 11, 2026
8e1da26
added pre generated attachment section
Venkatakrishnan774 Jun 12, 2026
6bfcf9d
added pre generated attachment section
Venkatakrishnan774 Jun 12, 2026
68079ab
added tests
Venkatakrishnan774 Jun 14, 2026
15606cd
added mcp way to communicate
Venkatakrishnan774 Jun 15, 2026
59426a3
added mcp way to communicate
Venkatakrishnan774 Jun 15, 2026
9b90568
added test
Venkatakrishnan774 Jun 15, 2026
d24cbf1
fixed tests
Venkatakrishnan774 Jun 19, 2026
db05f22
fixed test cases
Venkatakrishnan774 Jun 22, 2026
747705b
resolved review comments
Venkatakrishnan774 Jun 22, 2026
90e1c00
updated review comments
Venkatakrishnan774 Jun 22, 2026
1499178
updated document id
Venkatakrishnan774 Jun 22, 2026
5e8d7b8
fixed code quality checks
Venkatakrishnan774 Jun 22, 2026
aadfcd3
fixed code quality checks
Venkatakrishnan774 Jun 22, 2026
8608d13
Merge pull request #1 from SAP/main
Venkatakrishnan774 Jun 23, 2026
c02cfba
ruff checks done
Venkatakrishnan774 Jun 23, 2026
7ade94f
redesigned as per sdk conventions
Venkatakrishnan774 Jun 23, 2026
b49c131
updated tests
Venkatakrishnan774 Jun 23, 2026
72868ff
updated roff
Venkatakrishnan774 Jun 23, 2026
0cb2a35
Merge pull request #2 from SAP/main
Venkatakrishnan774 Jun 24, 2026
e947ce9
updated review comments
Venkatakrishnan774 Jun 25, 2026
4c07927
updated review comments
Venkatakrishnan774 Jun 25, 2026
cd90788
updated review comments
Venkatakrishnan774 Jun 25, 2026
8b4f46c
updated review comments
Venkatakrishnan774 Jun 25, 2026
0a4ff67
Merge remote-tracking branch 'origin/sap_om_poc' into sap_om_poc
Venkatakrishnan774 Jun 25, 2026
e9c7bb2
updated review comments
Venkatakrishnan774 Jun 26, 2026
82f122f
Merge branch 'main' into sap_om_poc
Venkatakrishnan774 Jun 29, 2026
39b0383
Update test_operation.py
Venkatakrishnan774 Jun 30, 2026
bd84c91
bumped version
Venkatakrishnan774 Jun 30, 2026
24ff48b
added integration tests
Venkatakrishnan774 Jul 7, 2026
ee80146
Merge branch 'main' into sap_om_poc
Venkatakrishnan774 Jul 13, 2026
f9a18d2
fixed review comments
Venkatakrishnan774 Jul 13, 2026
66749af
fixed tests
Venkatakrishnan774 Jul 14, 2026
e1a4dfd
Merge branch 'main' into sap_om_poc
Venkatakrishnan774 Jul 14, 2026
72624d6
updated client
Venkatakrishnan774 Jul 16, 2026
c0e0202
updated client
Venkatakrishnan774 Jul 16, 2026
8b64331
updated client
Venkatakrishnan774 Jul 16, 2026
d9065bc
Merge branch 'main' into sap_om_poc
Venkatakrishnan774 Jul 20, 2026
0cc186b
ruff format
Venkatakrishnan774 Jul 20, 2026
9045c19
updated integration tests
Jul 29, 2026
5ac60ed
remvoed
Jul 29, 2026
f22c685
fixed integration tests
Jul 29, 2026
2b014ee
Merge branch 'main' into sap_om_poc
Venkatakrishnan774 Jul 29, 2026
6db14fa
updated test module
Aug 3, 2026
198f07f
Merge branch 'main' into sap_om_poc
Venkatakrishnan774 Aug 3, 2026
cbe3f3a
Merge branch 'main' into sap_om_poc
Aug 3, 2026
b276af8
Merge remote-tracking branch 'origin/sap_om_poc' into sap_om_poc
Aug 4, 2026
2b68d9f
Merge remote-tracking branch 'origin/sap_om_poc' into sap_om_poc
Venkatakrishnan774 Aug 4, 2026
7eba1f7
Merge remote-tracking branch 'origin/sap_om_poc' into sap_om_poc
Aug 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions src/sap_cloud_sdk/outputmanagement/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"""SAP Ariba Output Management Service SDK for Python."""

from .client import (
OutputManagementServiceClient,
OutputManagementServiceDefaultClient,
)
from .client_provider import (
OutputManagementServiceClientProvider,
OutputManagementServiceClientProviderBuilder,
)
from .models.output_request import OutputRequest, OutputRequestBuilder
from .models.output_response import (
OutputResponse,
)
from .models.email_configuration import EmailConfiguration
from .models.attachment_config import AttachmentConfig
from .models.output_management_info import OutputManagementInfo
from .models.output_request_data import OutputRequestData
from .models.direct_share_configuration import DirectShareConfiguration
from .models.form_configuration import FormConfiguration
from .clients.email_client import EmailClient
from .config.destination_credential_config import DestinationCredentialConfig
from .constants import FileFormat, Channel, Status
from .exceptions import (
OutputManagementException,
AuthenticationException,
ValidationException,
NetworkException,
DestinationNotFoundException,
DestinationAccessException,
)

__version__ = "1.0.0"
Comment thread
Venkatakrishnan774 marked this conversation as resolved.
Outdated

__all__ = [
# Client classes
"OutputManagementServiceClient",
"OutputManagementServiceDefaultClient",
"OutputManagementServiceClientProvider",
"OutputManagementServiceClientProviderBuilder",
"EmailClient",
# Models
"OutputRequest",
"OutputRequestBuilder",
"OutputResponse",
"EmailConfiguration",
"AttachmentConfig",
"OutputManagementInfo",
"OutputRequestData",
"DirectShareConfiguration",
"FormConfiguration",
# Configuration
"DestinationCredentialConfig",
# Constants/Enums
"FileFormat",
"Channel",
"Status",
# Exceptions
"OutputManagementException",
"AuthenticationException",
"ValidationException",
"NetworkException",
"DestinationNotFoundException",
"DestinationAccessException",
]




83 changes: 83 additions & 0 deletions src/sap_cloud_sdk/outputmanagement/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
"""Main client classes."""

import logging
import requests
from abc import ABC, abstractmethod

from .clients.output_requests_client import OutputRequestsClient
from .clients.output_requests_client_impl import OutputRequestsClientImpl

logger = logging.getLogger(__name__)


class OutputManagementServiceClient(ABC):
"""Abstract base class for Output Management Service client."""

@abstractmethod
def get_output_requests_client(self) -> OutputRequestsClient:
"""Get output requests client.

Returns:
Output requests client
"""
pass


@abstractmethod
def close(self) -> None:
"""Close the client and release resources."""
pass


class OutputManagementServiceDefaultClient(OutputManagementServiceClient):
"""Default implementation of Output Management Service client."""

def __init__(
self,
base_url: str,
destination: any = None,
Comment thread
Venkatakrishnan774 marked this conversation as resolved.
Outdated
destination_instance: str = None,
Comment thread
Venkatakrishnan774 marked this conversation as resolved.
Outdated
):
"""Initialize client.

Args:
base_url: Base URL of the service
destination: Optional Cloud SDK destination object for making requests
destination_instance: Optional Destination Service instance name
"""
self._base_url = base_url.rstrip("/")
self._destination = destination
self._destination_instance = destination_instance

# Create a simple requests session
self._session = requests.Session()

# Initialize output requests client
self._output_requests_client = OutputRequestsClientImpl(
self._session,
self._base_url,
self._destination,
self._destination_instance,
)

logger.info(f"Initialized Output Management Service client for {base_url}")

def get_output_requests_client(self) -> OutputRequestsClient:
"""Get output requests client."""
return self._output_requests_client


def close(self) -> None:
"""Close the client and release resources."""
self._session.close()
logger.info("Output Management Service client closed")

def __enter__(self):
Comment thread
Venkatakrishnan774 marked this conversation as resolved.
Outdated
"""Context manager entry."""
return self

def __exit__(self, exc_type, exc_val, exc_tb):
Comment thread
Venkatakrishnan774 marked this conversation as resolved.
Outdated
"""Context manager exit."""
self.close()


94 changes: 94 additions & 0 deletions src/sap_cloud_sdk/outputmanagement/client_provider.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
"""Client provider and builder."""

import logging

from .client import (
OutputManagementServiceClient,
OutputManagementServiceDefaultClient,
)
from .config.destination_credential_config import DestinationCredentialConfig
from .exceptions import ValidationException

logger = logging.getLogger(__name__)


class OutputManagementServiceClientProvider:
"""Provider for Output Management Service client."""

def __init__(self, client: OutputManagementServiceClient):
"""Initialize provider.

Args:
client: Output Management Service client
"""
self._client = client

def get_client(self) -> OutputManagementServiceClient:
"""Get the client instance.

Returns:
Output Management Service client
"""
return self._client


class OutputManagementServiceClientProviderBuilder:
"""Builder for Output Management Service client provider."""

def __init__(self):
"""Initialize builder."""
self._destination_credential_config: DestinationCredentialConfig = None

def with_destination_credentials(
self, config: DestinationCredentialConfig
) -> "OutputManagementServiceClientProviderBuilder":
"""Configure with destination credentials.

Args:
config: Destination credential configuration

Returns:
Builder instance
"""
self._destination_credential_config = config
return self

def build(self) -> OutputManagementServiceClientProvider:
"""Build the client provider.

Returns:
Client provider

Raises:
ValidationException: If configuration is invalid
"""
if not self._destination_credential_config:
raise ValidationException(
"Destination credentials must be configured",
error_code="MISSING_CONFIGURATION",
)

# For destination credentials, use SAP Cloud SDK
logger.info("Using destination credential configuration")

# Get the destination object - it handles authentication automatically
http_destination = self._destination_credential_config.get_destination()

# Get the base URL from destinatiozxn
Comment thread
Venkatakrishnan774 marked this conversation as resolved.
Outdated
base_url = self._destination_credential_config.get_base_url()
logger.info(f"Retrieved destination base URL: {base_url}")

# Build client with destination object and instance name
# The destination object handles auth automatically
# Use the same instance for both destination fetch and certificate retrieval
client = OutputManagementServiceDefaultClient(
base_url=base_url,
destination=http_destination,
destination_instance=self._destination_credential_config.instance,
)

logger.info("Built Output Management Service client provider")

return OutputManagementServiceClientProvider(client)


11 changes: 11 additions & 0 deletions src/sap_cloud_sdk/outputmanagement/clients/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Client implementations."""

from .output_requests_client import OutputRequestsClient
from .output_requests_client_impl import OutputRequestsClientImpl
from .email_client import EmailClient

__all__ = [
"OutputRequestsClient",
"OutputRequestsClientImpl",
Comment thread
Venkatakrishnan774 marked this conversation as resolved.
Outdated
"EmailClient",
]
Loading
Loading