Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ When applicable, read the repository documentation in this order:
5. `docs/testing.md` β€” repository-specific testing strategy and command mapping
6. `docs/contributing.md` β€” repository-specific workflow and links to shared standards
7. `docs/documentation.md` β€” repository-specific documentation rules
8. `docs/unit_tests.md` β€” unit test structure and guidance
9. `docs/e2e_tests.md` β€” end-to-end test setup and execution

Then inspect the code paths relevant to the task:

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Start with these documents:
- [docs/architecture.md](docs/architecture.md): repository structure, layers, and key abstractions
- [docs/local-development.md](docs/local-development.md): Docker-only local setup and execution model
- [docs/testing.md](docs/testing.md): repository-specific test strategy and commands
- [docs/unit_tests.md](docs/unit_tests.md): unit test structure and guidance
- [docs/e2e_tests.md](docs/e2e_tests.md): end-to-end test setup and execution
- [docs/contributing.md](docs/contributing.md): repository-specific workflow and links to shared standards
- [docs/documentation.md](docs/documentation.md): repository-specific documentation rules
- [docs/rql.md](docs/rql.md): fluent RQL query builder guide
Expand Down
13 changes: 8 additions & 5 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ mpt_api_client/
β”‚
β”œβ”€β”€ models/ # Response models
β”‚ β”œβ”€β”€ model.py # Model base class (camelCase ↔ snake_case mapping)
β”‚ β”œβ”€β”€ collection.py # Collection[Model] β€” paginated result set
β”‚ β”œβ”€β”€ model_collection.py # ModelCollection β€” paginated result set
β”‚ β”œβ”€β”€ meta.py # Meta / Pagination metadata
β”‚ └── file_model.py # FileModel for binary responses
β”‚
Expand All @@ -60,8 +60,12 @@ mpt_api_client/
β”‚ β”œβ”€β”€ billing/ # Invoices, Ledgers, Journals, Statements, Credit memos, …
β”‚ β”œβ”€β”€ catalog/ # Products, Listings, Price lists, Authorizations, …
β”‚ β”œβ”€β”€ commerce/ # Agreements, Orders, Subscriptions, Assets
β”‚ β”œβ”€β”€ exchange/ # Exchange resources
β”‚ β”œβ”€β”€ helpdesk/ # Cases, Chats, Queues, Forms, …
β”‚ └── notifications/ # Messages, Batches, Subscribers, …
β”‚ β”œβ”€β”€ integration/ # Integration resources
β”‚ β”œβ”€β”€ notifications/ # Messages, Batches, Subscribers, …
β”‚ β”œβ”€β”€ program/ # Program resources
β”‚ └── spotlight/ # Spotlight resources
β”‚
└── rql/ # RQL query builder
β”œβ”€β”€ query_builder.py # RQLQuery, RQLProperty, RQLValue
Expand Down Expand Up @@ -129,6 +133,8 @@ Services are composed using **mixins** that add HTTP operations:
| `DownloadFileMixin` | download binary content |
| `EnableMixin` / `DisableMixin` | enable/disable actions |
| `QueryableMixin` | `filter()`, `order_by()`, `select()` β€” RQL query chaining |
| `StreamJSONLMixin` | `stream()` β€” stream JSONL records line by line (e.g. billing charges) |
| `FilesOperationsMixin` | combined file create / update / download operations |

Example service definition:

Expand Down Expand Up @@ -183,6 +189,3 @@ MPTError
β”œβ”€β”€ MPTHttpError # generic HTTP error (status_code, message, body)
β”‚ └── MPTAPIError # structured API error (payload, title, detail, trace_id)
```



4 changes: 4 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ client = MPTClient.from_config(
)
```

`from_config` also accepts a `timeout` argument (HTTP request timeout in seconds, default `60.0`).

## Synchronous Usage Patterns

Read a single resource:
Expand Down Expand Up @@ -115,6 +117,8 @@ The client exposes resource groups such as:
- `client.helpdesk`
- `client.integration`
- `client.notifications`
- `client.program`
- `client.spotlight`

See [architecture.md](architecture.md) for the repository structure and the
[MPT OpenAPI spec](https://docs.platform.softwareone.com/developer-resources/rest-api/openapi-specification)
Expand Down