Skip to content

Commit 3f69a90

Browse files
committed
feat(sdk): add GetOrders endpoint and bump to v1.0.18
- Add GetOrders API endpoint with GetOrdersResponse, OrderInfo, and OrderLineItem models, docs, and tests - Bump version to 1.0.18 across all version-bearing files (pyproject.toml, setup.py, config.json, __init__.py, api_client.py, configuration.py)
1 parent 14dbd17 commit 3f69a90

21 files changed

Lines changed: 1268 additions & 29 deletions

.openapi-generator/FILES

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ docs/GetCurrenciesResponse.md
1717
docs/GetCurrenciesResponseAllOfCurrencies.md
1818
docs/GetInvoicesDetailsResponse.md
1919
docs/GetInvoicesResponse.md
20+
docs/GetOrdersResponse.md
2021
docs/InvoiceDetailInfo.md
2122
docs/InvoiceInfo.md
2223
docs/InvoiceItem.md
24+
docs/OrderInfo.md
25+
docs/OrderLineItem.md
2326
docs/ProductInfo.md
2427
docs/UpdateClientResponse.md
2528
docs/WHMCSBaseResponse.md
@@ -32,28 +35,9 @@ setup.cfg
3235
setup.py
3336
test-requirements.txt
3437
test/__init__.py
35-
test/test_add_client_response.py
36-
test/test_add_order_response.py
37-
test/test_client_details_info.py
38-
test/test_client_info.py
39-
test/test_currency_info.py
40-
test/test_default_api.py
41-
test/test_get_clients_details_response.py
42-
test/test_get_clients_products_response.py
43-
test/test_get_clients_response.py
44-
test/test_get_clients_response_all_of_clients.py
45-
test/test_get_currencies_response.py
46-
test/test_get_currencies_response_all_of_currencies.py
47-
test/test_get_invoices_details_response.py
48-
test/test_get_invoices_response.py
49-
test/test_invoice_detail_info.py
50-
test/test_invoice_info.py
51-
test/test_invoice_item.py
52-
test/test_product_info.py
53-
test/test_update_client_response.py
54-
test/test_whmcs_base_response.py
55-
test/test_whmcs_error_response.py
56-
test/test_whmcs_success_response.py
38+
test/test_get_orders_response.py
39+
test/test_order_info.py
40+
test/test_order_line_item.py
5741
tox.ini
5842
whmcs_client/__init__.py
5943
whmcs_client/api/__init__.py
@@ -76,9 +60,12 @@ whmcs_client/models/get_currencies_response.py
7660
whmcs_client/models/get_currencies_response_all_of_currencies.py
7761
whmcs_client/models/get_invoices_details_response.py
7862
whmcs_client/models/get_invoices_response.py
63+
whmcs_client/models/get_orders_response.py
7964
whmcs_client/models/invoice_detail_info.py
8065
whmcs_client/models/invoice_info.py
8166
whmcs_client/models/invoice_item.py
67+
whmcs_client/models/order_info.py
68+
whmcs_client/models/order_line_item.py
8269
whmcs_client/models/product_info.py
8370
whmcs_client/models/update_client_response.py
8471
whmcs_client/models/whmcs_base_response.py

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ 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.17
12+
- Package version: 1.0.18
1313
- Generator version: 7.21.0-SNAPSHOT
1414
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
1515

@@ -126,6 +126,7 @@ Class | Method | HTTP request | Description
126126
*DefaultApi* | [**get_currencies**](docs/DefaultApi.md#get_currencies) | **POST** /api.php?action=GetCurrencies | Get currencies
127127
*DefaultApi* | [**get_invoices**](docs/DefaultApi.md#get_invoices) | **POST** /api.php?action=GetInvoices | Get invoices
128128
*DefaultApi* | [**get_invoices_details**](docs/DefaultApi.md#get_invoices_details) | **POST** /api.php?action=GetInvoicesDetails | Get invoices with line item details
129+
*DefaultApi* | [**get_orders**](docs/DefaultApi.md#get_orders) | **POST** /api.php?action=GetOrders | Get orders
129130
*DefaultApi* | [**update_client**](docs/DefaultApi.md#update_client) | **POST** /api.php?action=UpdateClient | Update client details
130131

131132

@@ -144,9 +145,12 @@ Class | Method | HTTP request | Description
144145
- [GetCurrenciesResponseAllOfCurrencies](docs/GetCurrenciesResponseAllOfCurrencies.md)
145146
- [GetInvoicesDetailsResponse](docs/GetInvoicesDetailsResponse.md)
146147
- [GetInvoicesResponse](docs/GetInvoicesResponse.md)
148+
- [GetOrdersResponse](docs/GetOrdersResponse.md)
147149
- [InvoiceDetailInfo](docs/InvoiceDetailInfo.md)
148150
- [InvoiceInfo](docs/InvoiceInfo.md)
149151
- [InvoiceItem](docs/InvoiceItem.md)
152+
- [OrderInfo](docs/OrderInfo.md)
153+
- [OrderLineItem](docs/OrderLineItem.md)
150154
- [ProductInfo](docs/ProductInfo.md)
151155
- [UpdateClientResponse](docs/UpdateClientResponse.md)
152156
- [WHMCSBaseResponse](docs/WHMCSBaseResponse.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.17",
4+
"packageVersion": "1.0.18",
55
"packageUrl": "https://github.com/truehostcloud/whmcs-python-client",
66
"packageCompany": "Truehost",
77
"packageAuthor": "William Mwai",

docs/DefaultApi.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Method | HTTP request | Description
1212
[**get_currencies**](DefaultApi.md#get_currencies) | **POST** /api.php?action=GetCurrencies | Get currencies
1313
[**get_invoices**](DefaultApi.md#get_invoices) | **POST** /api.php?action=GetInvoices | Get invoices
1414
[**get_invoices_details**](DefaultApi.md#get_invoices_details) | **POST** /api.php?action=GetInvoicesDetails | Get invoices with line item details
15+
[**get_orders**](DefaultApi.md#get_orders) | **POST** /api.php?action=GetOrders | Get orders
1516
[**update_client**](DefaultApi.md#update_client) | **POST** /api.php?action=UpdateClient | Update client details
1617

1718

@@ -811,6 +812,93 @@ No authorization required
811812

812813
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
813814

815+
# **get_orders**
816+
> GetOrdersResponse get_orders(username, password, accesskey=accesskey, responsetype=responsetype, limitstart=limitstart, limitnum=limitnum, id=id, userid=userid, requestor_id=requestor_id, status=status)
817+
818+
Get orders
819+
820+
Obtain orders matching the passed criteria
821+
822+
### Example
823+
824+
825+
```python
826+
import whmcs_client
827+
from whmcs_client.models.get_orders_response import GetOrdersResponse
828+
from whmcs_client.rest import ApiException
829+
from pprint import pprint
830+
831+
# Defining the host is optional and defaults to https://your-whmcs-instance.com/includes
832+
# See configuration.py for a list of all supported configuration parameters.
833+
configuration = whmcs_client.Configuration(
834+
host = "https://your-whmcs-instance.com/includes"
835+
)
836+
837+
838+
# Enter a context with an instance of the API client
839+
with whmcs_client.ApiClient(configuration) as api_client:
840+
# Create an instance of the API class
841+
api_instance = whmcs_client.DefaultApi(api_client)
842+
username = 'username_example' # str | Admin username/API identifier
843+
password = 'password_example' # str | Admin password/API secret
844+
accesskey = 'accesskey_example' # str | Optional API access key (optional)
845+
responsetype = json # str | Response format (optional) (default to json)
846+
limitstart = 0 # int | The offset for the returned order data (optional) (default to 0)
847+
limitnum = 25 # int | The number of records to return (optional) (default to 25)
848+
id = 56 # int | Find orders for a specific order id (optional)
849+
userid = 56 # int | Find orders for a specific client id (optional)
850+
requestor_id = 56 # int | Find orders for a specific requestor id (optional)
851+
status = 'status_example' # str | Find orders for a specific status (Active, Pending, Fraud, Cancelled) (optional)
852+
853+
try:
854+
# Get orders
855+
api_response = api_instance.get_orders(username, password, accesskey=accesskey, responsetype=responsetype, limitstart=limitstart, limitnum=limitnum, id=id, userid=userid, requestor_id=requestor_id, status=status)
856+
print("The response of DefaultApi->get_orders:\n")
857+
pprint(api_response)
858+
except Exception as e:
859+
print("Exception when calling DefaultApi->get_orders: %s\n" % e)
860+
```
861+
862+
863+
864+
### Parameters
865+
866+
867+
Name | Type | Description | Notes
868+
------------- | ------------- | ------------- | -------------
869+
**username** | **str**| Admin username/API identifier |
870+
**password** | **str**| Admin password/API secret |
871+
**accesskey** | **str**| Optional API access key | [optional]
872+
**responsetype** | **str**| Response format | [optional] [default to json]
873+
**limitstart** | **int**| The offset for the returned order data | [optional] [default to 0]
874+
**limitnum** | **int**| The number of records to return | [optional] [default to 25]
875+
**id** | **int**| Find orders for a specific order id | [optional]
876+
**userid** | **int**| Find orders for a specific client id | [optional]
877+
**requestor_id** | **int**| Find orders for a specific requestor id | [optional]
878+
**status** | **str**| Find orders for a specific status (Active, Pending, Fraud, Cancelled) | [optional]
879+
880+
### Return type
881+
882+
[**GetOrdersResponse**](GetOrdersResponse.md)
883+
884+
### Authorization
885+
886+
No authorization required
887+
888+
### HTTP request headers
889+
890+
- **Content-Type**: application/x-www-form-urlencoded
891+
- **Accept**: application/json
892+
893+
### HTTP response details
894+
895+
| Status code | Description | Response headers |
896+
|-------------|-------------|------------------|
897+
**200** | Orders retrieved successfully | - |
898+
**0** | Error response | - |
899+
900+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
901+
814902
# **update_client**
815903
> UpdateClientResponse update_client(username, password, clientid, accesskey=accesskey, responsetype=responsetype, clientemail=clientemail, firstname=firstname, lastname=lastname, companyname=companyname, email=email, address1=address1, address2=address2, city=city, state=state, postcode=postcode, country=country, phonenumber=phonenumber, tax_id=tax_id, password2=password2, securityqid=securityqid, securityqans=securityqans, currency=currency, groupid=groupid, customfields=customfields, language=language, clientip=clientip, notes=notes, status=status, paymentmethod=paymentmethod, email_preferences_general=email_preferences_general, email_preferences_product=email_preferences_product, email_preferences_domain=email_preferences_domain, email_preferences_invoice=email_preferences_invoice, email_preferences_support=email_preferences_support, email_preferences_affiliate=email_preferences_affiliate, clearcreditcard=clearcreditcard, latefeeoveride=latefeeoveride, overideduenotices=overideduenotices, taxexempt=taxexempt, separateinvoices=separateinvoices, disableautocc=disableautocc, overrideautoclose=overrideautoclose)
816904

docs/GetOrdersResponse.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# GetOrdersResponse
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**result** | **str** | | [optional]
9+
**message** | **str** | Response message | [optional]
10+
**totalresults** | **int** | The total number of results available | [optional]
11+
**startnumber** | **int** | The starting number for the returned results | [optional]
12+
**numreturned** | **int** | The number of results returned | [optional]
13+
**orders** | **object** | The orders collection | [optional]
14+
15+
## Example
16+
17+
```python
18+
from whmcs_client.models.get_orders_response import GetOrdersResponse
19+
20+
# TODO update the JSON string below
21+
json = "{}"
22+
# create an instance of GetOrdersResponse from a JSON string
23+
get_orders_response_instance = GetOrdersResponse.from_json(json)
24+
# print the JSON string representation of the object
25+
print(GetOrdersResponse.to_json())
26+
27+
# convert the object into a dict
28+
get_orders_response_dict = get_orders_response_instance.to_dict()
29+
# create an instance of GetOrdersResponse from a dict
30+
get_orders_response_from_dict = GetOrdersResponse.from_dict(get_orders_response_dict)
31+
```
32+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
33+
34+

docs/OrderInfo.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# OrderInfo
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**id** | **int** | The order ID | [optional]
9+
**ordernum** | **str** | The order number | [optional]
10+
**var_date** | **str** | The order date (YYYY-MM-DD HH:MM:SS) | [optional]
11+
**amount** | **str** | The order total amount | [optional]
12+
**paymentmethod** | **str** | The payment method identifier | [optional]
13+
**invoiceid** | **int** | The linked invoice ID | [optional]
14+
**status** | **str** | The order status (Active, Pending, Fraud, Cancelled) | [optional]
15+
**name** | **str** | The client name on the order | [optional]
16+
**lineitems** | **object** | The order line items collection | [optional]
17+
18+
## Example
19+
20+
```python
21+
from whmcs_client.models.order_info import OrderInfo
22+
23+
# TODO update the JSON string below
24+
json = "{}"
25+
# create an instance of OrderInfo from a JSON string
26+
order_info_instance = OrderInfo.from_json(json)
27+
# print the JSON string representation of the object
28+
print(OrderInfo.to_json())
29+
30+
# convert the object into a dict
31+
order_info_dict = order_info_instance.to_dict()
32+
# create an instance of OrderInfo from a dict
33+
order_info_from_dict = OrderInfo.from_dict(order_info_dict)
34+
```
35+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
36+
37+

docs/OrderLineItem.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# OrderLineItem
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**type** | **str** | The line item type (product, domain, addon) | [optional]
9+
**product** | **str** | The product name | [optional]
10+
**domain** | **str** | The associated domain | [optional]
11+
**billingcycle** | **str** | The billing cycle | [optional]
12+
**amount** | **str** | The line item amount | [optional]
13+
**status** | **str** | The line item status | [optional]
14+
15+
## Example
16+
17+
```python
18+
from whmcs_client.models.order_line_item import OrderLineItem
19+
20+
# TODO update the JSON string below
21+
json = "{}"
22+
# create an instance of OrderLineItem from a JSON string
23+
order_line_item_instance = OrderLineItem.from_json(json)
24+
# print the JSON string representation of the object
25+
print(OrderLineItem.to_json())
26+
27+
# convert the object into a dict
28+
order_line_item_dict = order_line_item_instance.to_dict()
29+
# create an instance of OrderLineItem from a dict
30+
order_line_item_from_dict = OrderLineItem.from_dict(order_line_item_dict)
31+
```
32+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
33+
34+

0 commit comments

Comments
 (0)