ds_protocol_soap_py_lib.dataset.soap¶
File: soap.py
Region: ds_protocol_soap_py_lib/dataset/soap
SOAP Dataset
This module implements a dataset for SOAP APIs.
Example
>>> import uuid
>>> from ds_protocol_soap_py_lib import SoapLinkedService, SoapLinkedServiceSettings
>>> from ds_protocol_soap_py_lib.dataset.soap import SoapDataset, SoapDatasetSettings
>>> from ds_protocol_soap_py_lib.enums import AuthType
>>> from ds_protocol_soap_py_lib.linked_service.soap import ParameterBasedAuthSettings
>>> linked_service = SoapLinkedService(
... id=uuid.uuid4(),
... name="example::linked_service",
... version="1.0.0",
... settings=SoapLinkedServiceSettings(
... wsdl="https://example.com/service?wsdl",
... auth_type=AuthType.PARAMETER_BASED,
... auth_test_method="Ping",
... parameter_based=ParameterBasedAuthSettings(
... auth_param_key1="apiKey",
... auth_param_value1="my-token",
... ),
... ),
... )
>>> linked_service.connect()
>>> dataset = SoapDataset(
... id=uuid.uuid4(),
... name="example::dataset",
... version="1.0.0",
... settings=SoapDatasetSettings(method="GetRecords"),
... linked_service=linked_service,
... )
>>> dataset.read()
>>> data = dataset.output
Attributes¶
Classes¶
Settings for SOAP dataset. |
|
Dataset for SOAP APIs. |
Module Contents¶
- ds_protocol_soap_py_lib.dataset.soap.logger¶
- class ds_protocol_soap_py_lib.dataset.soap.SoapDatasetSettings[source]¶
Bases:
ds_resource_plugin_py_lib.common.resource.dataset.DatasetSettingsSettings for SOAP dataset.
- method: str¶
The SOAP method to call.
- kwargs: dict[str, Any]¶
Additional keyword arguments to pass to the SOAP method alongside the auth parameters from the linked service.
- ds_protocol_soap_py_lib.dataset.soap.SoapDatasetSettingsType¶
- ds_protocol_soap_py_lib.dataset.soap.SoapLinkedServiceType¶
- class ds_protocol_soap_py_lib.dataset.soap.SoapDataset[source]¶
Bases:
ds_resource_plugin_py_lib.common.resource.dataset.TabularDataset[SoapLinkedServiceType,SoapDatasetSettingsType,ds_resource_plugin_py_lib.common.serde.serialize.PandasSerializer,ds_resource_plugin_py_lib.common.serde.deserialize.PandasDeserializer],Generic[SoapLinkedServiceType,SoapDatasetSettingsType]Dataset for SOAP APIs.
Calls a configured SOAP method via the linked service connection. Authentication parameters from the linked service are automatically injected into each call.
read()fetches data from the SOAP endpoint and populatesself.output.create()sends data to the SOAP endpoint. All other operations raiseNotSupportedError.- linked_service: SoapLinkedServiceType¶
- settings: SoapDatasetSettingsType¶
- deserializer: ds_resource_plugin_py_lib.common.serde.deserialize.PandasDeserializer | None¶
- property type: ds_protocol_soap_py_lib.enums.ResourceType¶
Get the type of the dataset.
- _invoke_method(error_cls: type[ds_resource_plugin_py_lib.common.resource.dataset.errors.ReadError | ds_resource_plugin_py_lib.common.resource.dataset.errors.CreateError]) Any[source]¶
Call the configured SOAP method and return the serialized response.
Returns
Noneif the SOAP response is empty.- Parameters:
error_cls – The error class to raise on failure (
ReadErrororCreateError).- Raises:
ReadError | CreateError – If the SOAP call fails.
- read() None[source]¶
Call the configured SOAP method and populate
self.output.The zeep response is serialised to native Python types via
zeep.helpers.serialize_objectand normalised into a DataFrame.- Raises:
ReadError – If the SOAP call fails or no deserializer is configured.
- create() None[source]¶
Call the configured SOAP method to create an entity.
Returns immediately if
self.inputis empty (no-op). Calls the SOAP method with auth params andsettings.kwargs. Setsself.outputto the deserialized backend response, or a copy ofself.inputif the response is empty or no deserializer is configured.- Raises:
CreateError – If the SOAP call fails.
- update() NoReturn[source]¶
Update existing rows in the target matched by identity columns defined in
self.settings. Atomic. Must not insert new rows.- Raises:
UpdateError – If the operation fails.
NotSupportedError – If the provider does not support update.
See also
Full contract:
docs/DATASET_CONTRACT.md–update()
- delete() NoReturn[source]¶
Remove specific rows from the target matched by identity columns defined in
self.settings. Atomic. Idempotent.- Raises:
DeleteError – If the operation fails.
NotSupportedError – If the provider does not support delete.
See also
Full contract:
docs/DATASET_CONTRACT.md–delete()
- upsert() NoReturn[source]¶
Insert rows that do not exist, update rows that do, matched by identity columns defined in
self.settings. Atomic.- Raises:
UpsertError – If the operation fails.
NotSupportedError – If the provider does not support upsert.
See also
Full contract:
docs/DATASET_CONTRACT.md–upsert()
- purge() NoReturn[source]¶
Remove all content from the target.
self.inputis not used. Atomic. Idempotent.- Raises:
PurgeError – If the operation fails.
NotSupportedError – If the provider does not support purge.
See also
Full contract:
docs/DATASET_CONTRACT.md–purge()
- list() NoReturn[source]¶
Discover available resources and populate
self.outputwith a DataFrame of resources and their metadata. Idempotent.- Raises:
ListError – If the operation fails.
NotSupportedError – If the provider does not support listing.
See also
Full contract:
docs/DATASET_CONTRACT.md–list()