https://github.com/im-cloud-spain-connectors/python-connect-business-objects
Connect Business Object (Request, Asset and Tier Configuration) Interface.
https://github.com/im-cloud-spain-connectors/python-connect-business-objects
business-transaction component connect models objects python transaction
Last synced: over 1 year ago
JSON representation
Connect Business Object (Request, Asset and Tier Configuration) Interface.
- Host: GitHub
- URL: https://github.com/im-cloud-spain-connectors/python-connect-business-objects
- Owner: IM-Cloud-Spain-Connectors
- License: apache-2.0
- Created: 2023-01-09T15:16:18.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-10-31T20:24:26.000Z (over 2 years ago)
- Last Synced: 2025-01-08T10:39:55.155Z (over 1 year ago)
- Topics: business-transaction, component, connect, models, objects, python, transaction
- Language: Python
- Homepage:
- Size: 48.8 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python Connect Business Objects
[](https://github.com/othercodes/python-connect-business-objects/actions/workflows/test.yml)
Connect Business Object (Request, Asset and Tier Configuration) Interface.
## Installation
The easiest way to install the Connect Business Objects library is to get the latest version from PyPI:
```bash
# using poetry
poetry add rndi-connect-business-objects
# using pip
pip install rndi-connect-business-objects
```
## The Contracts
This package provides the following contracts or interfaces:
* `ConfigurationSource`
* `ConfigurationBuilder`
* `ConnectionSource`
* `ConnectionBuilder`
* `ContractSource`
* `ContractBuilder`
* `EventsSource`
* `EventsBuilder`
* `MarketplaceSource`
* `MarketPlaceBuilder`
* `ParametersSource`
* `ProductSource`
* `ProductBuilder`
* `RequestSource`
* `RequestBuilder`
* `AssetSource`
* `AssetBuilder`
* `TierConfigurationSource`
* `TierConfigurationBuilder`
## The Adapters
This package provides several adapters and mixins that implements the contracts above. The main Adapters are:
### Request
Allow you to operate with a Connect Request Object (Asset Request or Tier Config Request).
* Contracts: `RequestSource`, `RequestBuilder`.
* Mixins: `HasContract`, `HasEvents`, `HasMarketplace`, `HasParameters`, `RequestSource`.
```python
from rndi.connect.business_objects.adapters import Request
# Create a new Request and set some values.
r = Request()
r.with_id('PR-000-000-001')
r.with_type('purchase')
r.with_status('pending')
# You can read the values too.
r.id() # PR-000-000-001
```
### Asset
Allow you to operate with a Connect Asset Object.
* Contracts: `AssetSource`, `AssetBuilder`.
* Mixins: `HasConfiguration`, `HasConnection`, `HasContract`, `HasMarketplace`, `HasParameters`, `HasProduct`.
```python
from rndi.connect.business_objects.adapters import Asset
# Create a new Asset and set some values.
a = Asset()
a.with_id('AS-000-000-001')
a.with_status('active')
a.with_external_id('123456789')
a.with_external_uid('9fb50525-a4a4-41a7-ace0-dc3c73796d32')
a.with_product('PRD-000-000-100', 'enabled')
# You can read the values too.
a.id() # AS-000-000-001
```
### TierConfiguration
Allow you to operate with a Connect Tier Configuration Object.
* Contracts: `TierConfigurationSource`, `TierConfigurationBuilder`.
* Mixins: `HasConfiguration`, `HasConnection`, `HasMarketplace`, `HasParameters`, `HasProduct`.
```python
from rndi.connect.business_objects.adapters import TierConfiguration
# Create a new TierConfiguration and set some values.
t = TierConfiguration()
t.with_id('TC-000-000-000')
t.with_status('active')
t.with_marketplace('MP-12345')
# You can read the values too.
t.id() # TC-000-000-000
```