Skip to content

Commit 12475f9

Browse files
committed
feat(sdk): add GetInvoices, GetClientsDetails, GetClientsProducts v1.0.14
Regenerates SDK to add three API actions required for invoice-driven bootstrap in athena: - GetInvoices: pagination, status filter (Unpaid/Overdue), orderby/order - GetClientsDetails: resolves client ID to email and phone number - GetClientsProducts: fetches active product list per client ID Adds all corresponding response and collection models: InvoiceInfo, InvoiceCollectionInvoice, ProductInfo, ProductCollectionProduct, GetInvoicesResponse, GetClientsProductsResponse, GetClientsDetailsResponse, ClientDetailsInfo, and all sub-models. Fixes to_dict() in InvoiceCollectionInvoice and ProductCollectionProduct to correctly handle both single-object and list responses from WHMCS, preventing AttributeError in the sync pipeline when a client has exactly one invoice or one product.
1 parent 2a67e0a commit 12475f9

File tree

121 files changed

+9935
-126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+9935
-126
lines changed

.github/workflows/python.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ name: whmcs_client Python package
77

88
on: [push, pull_request]
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
build:
1215

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ docs/_build/
6262
# PyBuilder
6363
target/
6464

65-
#Ipython Notebook
65+
# Ipython Notebook
6666
.ipynb_checkpoints

.openapi-generator/FILES

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,44 @@
55
README.md
66
docs/AddClientResponse.md
77
docs/AddOrderResponse.md
8+
docs/ClientDetailsInfo.md
9+
docs/ClientDetailsInfoAllowSingleSignOn.md
10+
docs/ClientDetailsInfoCustomfields.md
11+
docs/ClientDetailsStats.md
812
docs/ClientInfo.md
913
docs/CurrencyInfo.md
14+
docs/CustomFieldValue.md
15+
docs/CustomFieldValueId.md
1016
docs/DefaultApi.md
17+
docs/EmailPreferences.md
18+
docs/GetClientsDetailsResponse.md
19+
docs/GetClientsProductsResponse.md
20+
docs/GetClientsProductsResponseAllOfClientid.md
21+
docs/GetClientsProductsResponseAllOfPid.md
22+
docs/GetClientsProductsResponseAllOfServiceid.md
1123
docs/GetClientsResponse.md
1224
docs/GetClientsResponseAllOfClients.md
1325
docs/GetCurrenciesResponse.md
1426
docs/GetCurrenciesResponseAllOfCurrencies.md
27+
docs/GetInvoicesResponse.md
28+
docs/InvoiceCollection.md
29+
docs/InvoiceCollectionInvoice.md
30+
docs/InvoiceInfo.md
31+
docs/InvoiceInfoPaymethodid.md
32+
docs/ProductCollection.md
33+
docs/ProductCollectionProduct.md
34+
docs/ProductInfo.md
35+
docs/ProductInfoClientid.md
36+
docs/ProductInfoId.md
37+
docs/ProductInfoOrderid.md
38+
docs/ProductInfoPid.md
39+
docs/ProductInfoPromoid.md
40+
docs/ProductInfoQty.md
41+
docs/ProductInfoServerid.md
1542
docs/UpdateClientResponse.md
43+
docs/UserCollection.md
44+
docs/UserCollectionUser.md
45+
docs/UserInfo.md
1646
docs/WHMCSBaseResponse.md
1747
docs/WHMCSErrorResponse.md
1848
docs/WHMCSSuccessResponse.md
@@ -23,6 +53,36 @@ setup.cfg
2353
setup.py
2454
test-requirements.txt
2555
test/__init__.py
56+
test/test_client_details_info.py
57+
test/test_client_details_info_allow_single_sign_on.py
58+
test/test_client_details_info_customfields.py
59+
test/test_client_details_stats.py
60+
test/test_custom_field_value.py
61+
test/test_custom_field_value_id.py
62+
test/test_email_preferences.py
63+
test/test_get_clients_details_response.py
64+
test/test_get_clients_products_response.py
65+
test/test_get_clients_products_response_all_of_clientid.py
66+
test/test_get_clients_products_response_all_of_pid.py
67+
test/test_get_clients_products_response_all_of_serviceid.py
68+
test/test_get_invoices_response.py
69+
test/test_invoice_collection.py
70+
test/test_invoice_collection_invoice.py
71+
test/test_invoice_info.py
72+
test/test_invoice_info_paymethodid.py
73+
test/test_product_collection.py
74+
test/test_product_collection_product.py
75+
test/test_product_info.py
76+
test/test_product_info_clientid.py
77+
test/test_product_info_id.py
78+
test/test_product_info_orderid.py
79+
test/test_product_info_pid.py
80+
test/test_product_info_promoid.py
81+
test/test_product_info_qty.py
82+
test/test_product_info_serverid.py
83+
test/test_user_collection.py
84+
test/test_user_collection_user.py
85+
test/test_user_info.py
2686
tox.ini
2787
whmcs_client/__init__.py
2888
whmcs_client/api/__init__.py
@@ -34,13 +94,43 @@ whmcs_client/exceptions.py
3494
whmcs_client/models/__init__.py
3595
whmcs_client/models/add_client_response.py
3696
whmcs_client/models/add_order_response.py
97+
whmcs_client/models/client_details_info.py
98+
whmcs_client/models/client_details_info_allow_single_sign_on.py
99+
whmcs_client/models/client_details_info_customfields.py
100+
whmcs_client/models/client_details_stats.py
37101
whmcs_client/models/client_info.py
38102
whmcs_client/models/currency_info.py
103+
whmcs_client/models/custom_field_value.py
104+
whmcs_client/models/custom_field_value_id.py
105+
whmcs_client/models/email_preferences.py
106+
whmcs_client/models/get_clients_details_response.py
107+
whmcs_client/models/get_clients_products_response.py
108+
whmcs_client/models/get_clients_products_response_all_of_clientid.py
109+
whmcs_client/models/get_clients_products_response_all_of_pid.py
110+
whmcs_client/models/get_clients_products_response_all_of_serviceid.py
39111
whmcs_client/models/get_clients_response.py
40112
whmcs_client/models/get_clients_response_all_of_clients.py
41113
whmcs_client/models/get_currencies_response.py
42114
whmcs_client/models/get_currencies_response_all_of_currencies.py
115+
whmcs_client/models/get_invoices_response.py
116+
whmcs_client/models/invoice_collection.py
117+
whmcs_client/models/invoice_collection_invoice.py
118+
whmcs_client/models/invoice_info.py
119+
whmcs_client/models/invoice_info_paymethodid.py
120+
whmcs_client/models/product_collection.py
121+
whmcs_client/models/product_collection_product.py
122+
whmcs_client/models/product_info.py
123+
whmcs_client/models/product_info_clientid.py
124+
whmcs_client/models/product_info_id.py
125+
whmcs_client/models/product_info_orderid.py
126+
whmcs_client/models/product_info_pid.py
127+
whmcs_client/models/product_info_promoid.py
128+
whmcs_client/models/product_info_qty.py
129+
whmcs_client/models/product_info_serverid.py
43130
whmcs_client/models/update_client_response.py
131+
whmcs_client/models/user_collection.py
132+
whmcs_client/models/user_collection_user.py
133+
whmcs_client/models/user_info.py
44134
whmcs_client/models/whmcs_base_response.py
45135
whmcs_client/models/whmcs_error_response.py
46136
whmcs_client/models/whmcs_success_response.py

.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.13.0
1+
7.21.0-SNAPSHOT

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ each action as an independent path while routing all requests to the /api.php en
99
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
1010

1111
- API version: 1.0.0
12-
- Package version: 1.0.13
13-
- Generator version: 7.13.0
12+
- Package version: 1.0.14
13+
- Generator version: 7.21.0-SNAPSHOT
1414
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
1515

1616
## Requirements.
@@ -121,21 +121,54 @@ Class | Method | HTTP request | Description
121121
*DefaultApi* | [**add_client**](docs/DefaultApi.md#add_client) | **POST** /api.php?action=AddClient | Add a new client
122122
*DefaultApi* | [**add_order**](docs/DefaultApi.md#add_order) | **POST** /api.php?action=AddOrder | Create a new order
123123
*DefaultApi* | [**get_clients**](docs/DefaultApi.md#get_clients) | **POST** /api.php?action=GetClients | Get clients
124+
*DefaultApi* | [**get_clients_details**](docs/DefaultApi.md#get_clients_details) | **POST** /api.php?action=GetClientsDetails | Get client details
125+
*DefaultApi* | [**get_clients_products**](docs/DefaultApi.md#get_clients_products) | **POST** /api.php?action=GetClientsProducts | Get client products
124126
*DefaultApi* | [**get_currencies**](docs/DefaultApi.md#get_currencies) | **POST** /api.php?action=GetCurrencies | Get currencies
127+
*DefaultApi* | [**get_invoices**](docs/DefaultApi.md#get_invoices) | **POST** /api.php?action=GetInvoices | Get invoices
125128
*DefaultApi* | [**update_client**](docs/DefaultApi.md#update_client) | **POST** /api.php?action=UpdateClient | Update client details
126129

127130

128131
## Documentation For Models
129132

130133
- [AddClientResponse](docs/AddClientResponse.md)
131134
- [AddOrderResponse](docs/AddOrderResponse.md)
135+
- [ClientDetailsInfo](docs/ClientDetailsInfo.md)
136+
- [ClientDetailsInfoAllowSingleSignOn](docs/ClientDetailsInfoAllowSingleSignOn.md)
137+
- [ClientDetailsInfoCustomfields](docs/ClientDetailsInfoCustomfields.md)
138+
- [ClientDetailsStats](docs/ClientDetailsStats.md)
132139
- [ClientInfo](docs/ClientInfo.md)
133140
- [CurrencyInfo](docs/CurrencyInfo.md)
141+
- [CustomFieldValue](docs/CustomFieldValue.md)
142+
- [CustomFieldValueId](docs/CustomFieldValueId.md)
143+
- [EmailPreferences](docs/EmailPreferences.md)
144+
- [GetClientsDetailsResponse](docs/GetClientsDetailsResponse.md)
145+
- [GetClientsProductsResponse](docs/GetClientsProductsResponse.md)
146+
- [GetClientsProductsResponseAllOfClientid](docs/GetClientsProductsResponseAllOfClientid.md)
147+
- [GetClientsProductsResponseAllOfPid](docs/GetClientsProductsResponseAllOfPid.md)
148+
- [GetClientsProductsResponseAllOfServiceid](docs/GetClientsProductsResponseAllOfServiceid.md)
134149
- [GetClientsResponse](docs/GetClientsResponse.md)
135150
- [GetClientsResponseAllOfClients](docs/GetClientsResponseAllOfClients.md)
136151
- [GetCurrenciesResponse](docs/GetCurrenciesResponse.md)
137152
- [GetCurrenciesResponseAllOfCurrencies](docs/GetCurrenciesResponseAllOfCurrencies.md)
153+
- [GetInvoicesResponse](docs/GetInvoicesResponse.md)
154+
- [InvoiceCollection](docs/InvoiceCollection.md)
155+
- [InvoiceCollectionInvoice](docs/InvoiceCollectionInvoice.md)
156+
- [InvoiceInfo](docs/InvoiceInfo.md)
157+
- [InvoiceInfoPaymethodid](docs/InvoiceInfoPaymethodid.md)
158+
- [ProductCollection](docs/ProductCollection.md)
159+
- [ProductCollectionProduct](docs/ProductCollectionProduct.md)
160+
- [ProductInfo](docs/ProductInfo.md)
161+
- [ProductInfoClientid](docs/ProductInfoClientid.md)
162+
- [ProductInfoId](docs/ProductInfoId.md)
163+
- [ProductInfoOrderid](docs/ProductInfoOrderid.md)
164+
- [ProductInfoPid](docs/ProductInfoPid.md)
165+
- [ProductInfoPromoid](docs/ProductInfoPromoid.md)
166+
- [ProductInfoQty](docs/ProductInfoQty.md)
167+
- [ProductInfoServerid](docs/ProductInfoServerid.md)
138168
- [UpdateClientResponse](docs/UpdateClientResponse.md)
169+
- [UserCollection](docs/UserCollection.md)
170+
- [UserCollectionUser](docs/UserCollectionUser.md)
171+
- [UserInfo](docs/UserInfo.md)
139172
- [WHMCSBaseResponse](docs/WHMCSBaseResponse.md)
140173
- [WHMCSErrorResponse](docs/WHMCSErrorResponse.md)
141174
- [WHMCSSuccessResponse](docs/WHMCSSuccessResponse.md)

config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"packageName": "whmcs_client",
33
"projectName": "whmcs-api-client",
4-
"packageVersion": "1.0.13",
4+
"packageVersion": "1.0.14",
55
"packageUrl": "https://github.com/truehostcloud/whmcs-python-client",
66
"packageCompany": "Truehost",
77
"packageAuthor": "William Mwai",

docs/ClientDetailsInfo.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# ClientDetailsInfo
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**client_id** | **int** | The client ID | [optional]
9+
**owner_user_id** | **int** | The owning user ID | [optional]
10+
**userid** | **int** | The client ID alias | [optional]
11+
**id** | **int** | The client ID | [optional]
12+
**uuid** | **str** | The client UUID | [optional]
13+
**firstname** | **str** | The client first name | [optional]
14+
**lastname** | **str** | The client last name | [optional]
15+
**fullname** | **str** | The client full name | [optional]
16+
**companyname** | **str** | The client company name | [optional]
17+
**email** | **str** | The client email address | [optional]
18+
**address1** | **str** | Address line 1 | [optional]
19+
**address2** | **str** | Address line 2 | [optional]
20+
**city** | **str** | City | [optional]
21+
**fullstate** | **str** | Full state name | [optional]
22+
**state** | **str** | State code or value | [optional]
23+
**postcode** | **str** | Post code | [optional]
24+
**countrycode** | **str** | Country code | [optional]
25+
**country** | **str** | Country | [optional]
26+
**phonenumber** | **str** | Phone number | [optional]
27+
**tax_id** | **str** | Tax ID | [optional]
28+
**email_preferences** | [**EmailPreferences**](EmailPreferences.md) | | [optional]
29+
**statecode** | **str** | State code | [optional]
30+
**countryname** | **str** | Country name | [optional]
31+
**phonecc** | **str** | Phone country code | [optional]
32+
**phonenumberformatted** | **str** | Formatted phone number | [optional]
33+
**telephone_number** | **str** | Alternate formatted phone number | [optional]
34+
**billingcid** | **int** | Billing contact ID | [optional]
35+
**notes** | **str** | Admin notes | [optional]
36+
**currency** | **int** | Currency ID | [optional]
37+
**defaultgateway** | **str** | Default gateway | [optional]
38+
**groupid** | **int** | Group ID | [optional]
39+
**status** | **str** | Client status | [optional]
40+
**credit** | **str** | Credit balance | [optional]
41+
**taxexempt** | **bool** | Whether the client is tax exempt | [optional]
42+
**latefeeoveride** | **bool** | Whether late fees are overridden | [optional]
43+
**overideduenotices** | **bool** | Whether due notices are overridden | [optional]
44+
**separateinvoices** | **bool** | Whether invoices are separated | [optional]
45+
**disableautocc** | **bool** | Whether auto credit card processing is disabled | [optional]
46+
**emailoptout** | **bool** | Whether the client has opted out of emails | [optional]
47+
**marketing_emails_opt_in** | **bool** | Whether the client has opted in to marketing emails | [optional]
48+
**overrideautoclose** | **bool** | Whether auto close is overridden | [optional]
49+
**allow_single_sign_on** | [**ClientDetailsInfoAllowSingleSignOn**](ClientDetailsInfoAllowSingleSignOn.md) | | [optional]
50+
**email_verified** | **bool** | Whether the email is verified | [optional]
51+
**language** | **str** | Preferred language | [optional]
52+
**is_opted_in_to_marketing_emails** | **bool** | Alternate marketing opt-in flag | [optional]
53+
**lastlogin** | **str** | Last login summary | [optional]
54+
**currency_code** | **str** | Currency code | [optional]
55+
**customfields** | [**ClientDetailsInfoCustomfields**](ClientDetailsInfoCustomfields.md) | | [optional]
56+
**users** | [**UserCollection**](UserCollection.md) | | [optional]
57+
58+
## Example
59+
60+
```python
61+
from whmcs_client.models.client_details_info import ClientDetailsInfo
62+
63+
# TODO update the JSON string below
64+
json = "{}"
65+
# create an instance of ClientDetailsInfo from a JSON string
66+
client_details_info_instance = ClientDetailsInfo.from_json(json)
67+
# print the JSON string representation of the object
68+
print(ClientDetailsInfo.to_json())
69+
70+
# convert the object into a dict
71+
client_details_info_dict = client_details_info_instance.to_dict()
72+
# create an instance of ClientDetailsInfo from a dict
73+
client_details_info_from_dict = ClientDetailsInfo.from_dict(client_details_info_dict)
74+
```
75+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
76+
77+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# ClientDetailsInfoAllowSingleSignOn
2+
3+
Whether single sign-on is allowed
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
10+
## Example
11+
12+
```python
13+
from whmcs_client.models.client_details_info_allow_single_sign_on import ClientDetailsInfoAllowSingleSignOn
14+
15+
# TODO update the JSON string below
16+
json = "{}"
17+
# create an instance of ClientDetailsInfoAllowSingleSignOn from a JSON string
18+
client_details_info_allow_single_sign_on_instance = ClientDetailsInfoAllowSingleSignOn.from_json(json)
19+
# print the JSON string representation of the object
20+
print(ClientDetailsInfoAllowSingleSignOn.to_json())
21+
22+
# convert the object into a dict
23+
client_details_info_allow_single_sign_on_dict = client_details_info_allow_single_sign_on_instance.to_dict()
24+
# create an instance of ClientDetailsInfoAllowSingleSignOn from a dict
25+
client_details_info_allow_single_sign_on_from_dict = ClientDetailsInfoAllowSingleSignOn.from_dict(client_details_info_allow_single_sign_on_dict)
26+
```
27+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
28+
29+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# ClientDetailsInfoCustomfields
2+
3+
Custom field values
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
10+
## Example
11+
12+
```python
13+
from whmcs_client.models.client_details_info_customfields import ClientDetailsInfoCustomfields
14+
15+
# TODO update the JSON string below
16+
json = "{}"
17+
# create an instance of ClientDetailsInfoCustomfields from a JSON string
18+
client_details_info_customfields_instance = ClientDetailsInfoCustomfields.from_json(json)
19+
# print the JSON string representation of the object
20+
print(ClientDetailsInfoCustomfields.to_json())
21+
22+
# convert the object into a dict
23+
client_details_info_customfields_dict = client_details_info_customfields_instance.to_dict()
24+
# create an instance of ClientDetailsInfoCustomfields from a dict
25+
client_details_info_customfields_from_dict = ClientDetailsInfoCustomfields.from_dict(client_details_info_customfields_dict)
26+
```
27+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
28+
29+

0 commit comments

Comments
 (0)