Skip to content

Commit 4690364

Browse files
Documentation
1 parent eba0ca9 commit 4690364

3 files changed

Lines changed: 33 additions & 7 deletions

File tree

README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,40 @@
1-
### Auto generate models
1+
# HelloAsso API Wrapper
22

3-
Download the swagger file from the HelloAsso API documentation. It use an old swagger 2 version. You need to convert it to OpenAPI 3.0.0 version. You can use the online tool [Swagger Editor](https://editor.swagger.io/).
3+
[![versions](https://img.shields.io/pypi/pyversions/HelloAssoAPIWrapper)](https://github.com/aeecleclair/HelloAssoAPIWrapper)
4+
[![license](https://img.shields.io/github/license/aeecleclair/HelloAssoAPIWrapper)](https://github.com/aeecleclair/HelloAssoAPIWrapper/blob/main/LICENSE)
5+
[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)
46

5-
Then you can use the `datamodel-codegen` tool to generate the models:
7+
A Python wrapper for the HelloAsso API, using [Pydantic](https://docs.pydantic.dev/latest/) for models validation.
68

7-
```bash
8-
datamodel-codegen --input HelloAssoV5OpenAPI.json --output HelloAssoAPIWrapper
9+
# Usage
10+
11+
```python
12+
from HelloAssoAPIWrapper import HelloAssoAPIWrapper
913
```
1014

1115
### Notification result webhooks
1216

1317
You should configure a webhook to receive the notification results.
1418
HelloAsso will make a POST request to the URL you provided with a JSON payload corresponding to a `NotificationResultContent` object.
19+
20+
## HelloAsso sandbox
21+
22+
HelloAsso provide a sandbox: api.helloasso-sandbox.com
23+
24+
# Development
25+
26+
Models when first generated using HelloAsso swagger documentation, and then adapted to include additional models, use stricter types and add documentation
27+
28+
## Add new methods
29+
30+
todo
31+
32+
## Models auto-generation
33+
34+
Download the swagger file from the HelloAsso API documentation. It use an old swagger 2 version. You need to convert it to OpenAPI 3.0.0 version. You can use the online tool [Swagger Editor](https://editor.swagger.io/).
35+
36+
Then you can use the [datamodel-codegen](https://docs.pydantic.dev/latest/integrations/datamodel_code_generator/) tool to generate the models:
37+
38+
```bash
39+
datamodel-codegen --input HelloAssoV5OpenAPI.json --output HelloAssoAPIWrapper
40+
```

helloasso_api_wrapper/models/carts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CheckoutPayer(BaseModel):
3030

3131

3232
class InitCheckoutResponse(BaseModel):
33-
id: int
33+
id: int # checkoutIntentId
3434
redirectUrl: str
3535

3636

helloasso_api_wrapper/models/statistics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class PaymentItem(BaseModel):
133133
shareAmount: int | None = None
134134
shareItemAmount: int | None = None
135135
shareOptionsAmount: int | None = None
136-
id: int | None = None
136+
id: int | None = None # order id
137137
amount: int | None = None
138138
type: enums.TierType | None = None
139139
initialAmount: int | None = None

0 commit comments

Comments
 (0)