Skip to content

Commit 3e1fb45

Browse files
committed
Add new models and update existing ones for client ID handling
- Introduced `AddClientResponseAllOfClientid`, `AddOrderRequestClientid`, `UpdateClientRequestClientid`, and their respective response models to encapsulate client ID as a distinct type. - Updated `AddClientResponse`, `AddOrderResponse`, `UpdateClientResponse` to utilize the new client ID models. - Modified API documentation to reflect changes in client ID handling. - Adjusted OpenAPI specifications to support both string and integer types for client IDs. - Refactored validation logic in models to use `anyOf` instead of `oneOf` for better type handling. - Ensured backward compatibility by maintaining existing functionality while enhancing type safety and clarity.
1 parent 27c87e9 commit 3e1fb45

15 files changed

+213
-198
lines changed

.openapi-generator/FILES

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
.travis.yml
55
README.md
66
docs/AddClientResponse.md
7+
docs/AddClientResponseAllOfClientid.md
8+
docs/AddOrderRequestClientid.md
79
docs/AddOrderResponse.md
810
docs/ClientInfo.md
911
docs/CurrencyInfo.md
@@ -12,7 +14,9 @@ docs/GetClientsResponse.md
1214
docs/GetClientsResponseAllOfClients.md
1315
docs/GetCurrenciesResponse.md
1416
docs/GetCurrenciesResponseAllOfCurrencies.md
17+
docs/UpdateClientRequestClientid.md
1518
docs/UpdateClientResponse.md
19+
docs/UpdateClientResponseAllOfClientid.md
1620
docs/WHMCSBaseResponse.md
1721
docs/WHMCSErrorResponse.md
1822
docs/WHMCSSuccessResponse.md
@@ -33,14 +37,18 @@ whmcs_client/configuration.py
3337
whmcs_client/exceptions.py
3438
whmcs_client/models/__init__.py
3539
whmcs_client/models/add_client_response.py
40+
whmcs_client/models/add_client_response_all_of_clientid.py
41+
whmcs_client/models/add_order_request_clientid.py
3642
whmcs_client/models/add_order_response.py
3743
whmcs_client/models/client_info.py
3844
whmcs_client/models/currency_info.py
3945
whmcs_client/models/get_clients_response.py
4046
whmcs_client/models/get_clients_response_all_of_clients.py
4147
whmcs_client/models/get_currencies_response.py
4248
whmcs_client/models/get_currencies_response_all_of_currencies.py
49+
whmcs_client/models/update_client_request_clientid.py
4350
whmcs_client/models/update_client_response.py
51+
whmcs_client/models/update_client_response_all_of_clientid.py
4452
whmcs_client/models/whmcs_base_response.py
4553
whmcs_client/models/whmcs_error_response.py
4654
whmcs_client/models/whmcs_success_response.py

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,18 @@ Class | Method | HTTP request | Description
128128
## Documentation For Models
129129

130130
- [AddClientResponse](docs/AddClientResponse.md)
131+
- [AddClientResponseAllOfClientid](docs/AddClientResponseAllOfClientid.md)
132+
- [AddOrderRequestClientid](docs/AddOrderRequestClientid.md)
131133
- [AddOrderResponse](docs/AddOrderResponse.md)
132134
- [ClientInfo](docs/ClientInfo.md)
133135
- [CurrencyInfo](docs/CurrencyInfo.md)
134136
- [GetClientsResponse](docs/GetClientsResponse.md)
135137
- [GetClientsResponseAllOfClients](docs/GetClientsResponseAllOfClients.md)
136138
- [GetCurrenciesResponse](docs/GetCurrenciesResponse.md)
137139
- [GetCurrenciesResponseAllOfCurrencies](docs/GetCurrenciesResponseAllOfCurrencies.md)
140+
- [UpdateClientRequestClientid](docs/UpdateClientRequestClientid.md)
138141
- [UpdateClientResponse](docs/UpdateClientResponse.md)
142+
- [UpdateClientResponseAllOfClientid](docs/UpdateClientResponseAllOfClientid.md)
139143
- [WHMCSBaseResponse](docs/WHMCSBaseResponse.md)
140144
- [WHMCSErrorResponse](docs/WHMCSErrorResponse.md)
141145
- [WHMCSSuccessResponse](docs/WHMCSSuccessResponse.md)

docs/AddClientResponse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**result** | **str** | | [optional]
99
**message** | **str** | Response message | [optional]
10-
**clientid** | **object** | The ID of the newly created client | [optional]
10+
**clientid** | [**AddClientResponseAllOfClientid**](AddClientResponseAllOfClientid.md) | | [optional]
1111
**owner_user_id** | **int** | The ID of the user that owns the client | [optional]
1212

1313
## Example

docs/DefaultApi.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ Places a new order for products/services
148148

149149
```python
150150
import whmcs_client
151+
from whmcs_client.models.add_order_request_clientid import AddOrderRequestClientid
151152
from whmcs_client.models.add_order_response import AddOrderResponse
152153
from whmcs_client.rest import ApiException
153154
from pprint import pprint
@@ -165,7 +166,7 @@ with whmcs_client.ApiClient(configuration) as api_client:
165166
api_instance = whmcs_client.DefaultApi(api_client)
166167
username = 'username_example' # str | Admin username/API identifier
167168
password = 'password_example' # str | Admin password/API secret
168-
clientid = None # object | The ID of the client to add the order for
169+
clientid = whmcs_client.AddOrderRequestClientid() # AddOrderRequestClientid |
169170
paymentmethod = 'paymentmethod_example' # str | The payment method for the order in the system format (e.g., paypal, mailin)
170171
accesskey = 'accesskey_example' # str | Optional API access key (optional)
171172
responsetype = json # str | Response format (optional) (default to json)
@@ -231,7 +232,7 @@ Name | Type | Description | Notes
231232
------------- | ------------- | ------------- | -------------
232233
**username** | **str**| Admin username/API identifier |
233234
**password** | **str**| Admin password/API secret |
234-
**clientid** | [**object**](object.md)| The ID of the client to add the order for |
235+
**clientid** | [**AddOrderRequestClientid**](AddOrderRequestClientid.md)| |
235236
**paymentmethod** | **str**| The payment method for the order in the system format (e.g., paypal, mailin) |
236237
**accesskey** | **str**| Optional API access key | [optional]
237238
**responsetype** | **str**| Response format | [optional] [default to json]
@@ -475,6 +476,7 @@ Modifies an existing client's information
475476

476477
```python
477478
import whmcs_client
479+
from whmcs_client.models.update_client_request_clientid import UpdateClientRequestClientid
478480
from whmcs_client.models.update_client_response import UpdateClientResponse
479481
from whmcs_client.rest import ApiException
480482
from pprint import pprint
@@ -492,7 +494,7 @@ with whmcs_client.ApiClient(configuration) as api_client:
492494
api_instance = whmcs_client.DefaultApi(api_client)
493495
username = 'username_example' # str | Admin username/API identifier
494496
password = 'password_example' # str | Admin password/API secret
495-
clientid = None # object | The ID of the client to update
497+
clientid = whmcs_client.UpdateClientRequestClientid() # UpdateClientRequestClientid |
496498
accesskey = 'accesskey_example' # str | Optional API access key (optional)
497499
responsetype = json # str | Response format (optional) (default to json)
498500
clientemail = 'clientemail_example' # str | The email address of the client to update (optional)
@@ -551,7 +553,7 @@ Name | Type | Description | Notes
551553
------------- | ------------- | ------------- | -------------
552554
**username** | **str**| Admin username/API identifier |
553555
**password** | **str**| Admin password/API secret |
554-
**clientid** | [**object**](object.md)| The ID of the client to update |
556+
**clientid** | [**UpdateClientRequestClientid**](UpdateClientRequestClientid.md)| |
555557
**accesskey** | **str**| Optional API access key | [optional]
556558
**responsetype** | **str**| Response format | [optional] [default to json]
557559
**clientemail** | **str**| The email address of the client to update | [optional]

docs/UpdateClientResponse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**result** | **str** | | [optional]
99
**message** | **str** | Response message | [optional]
10-
**clientid** | **str** | The ID of the updated client | [optional]
10+
**clientid** | [**UpdateClientResponseAllOfClientid**](UpdateClientResponseAllOfClientid.md) | | [optional]
1111

1212
## Example
1313

openapi.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,9 @@ components:
245245
- clientid
246246
properties:
247247
clientid:
248-
type: [string, integer]
248+
anyOf:
249+
- type: integer
250+
- type: string
249251
description: The ID of the client to update
250252
clientemail:
251253
type: string
@@ -366,7 +368,9 @@ components:
366368
- paymentmethod
367369
properties:
368370
clientid:
369-
type: [string, integer]
371+
anyOf:
372+
- type: integer
373+
- type: string
370374
description: The ID of the client to add the order for
371375
clientemail:
372376
type: string
@@ -624,7 +628,9 @@ components:
624628
- type: object
625629
properties:
626630
clientid:
627-
type: [string, integer]
631+
anyOf:
632+
- type: integer
633+
- type: string
628634
description: The ID of the newly created client
629635
owner_user_id:
630636
type: integer
@@ -636,7 +642,9 @@ components:
636642
- type: object
637643
properties:
638644
clientid:
639-
type: string
645+
anyOf:
646+
- type: integer
647+
- type: string
640648
description: The ID of the updated client
641649

642650
AddOrderResponse:

whmcs_client/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,18 @@
3232

3333
# import models into sdk package
3434
from whmcs_client.models.add_client_response import AddClientResponse
35+
from whmcs_client.models.add_client_response_all_of_clientid import AddClientResponseAllOfClientid
36+
from whmcs_client.models.add_order_request_clientid import AddOrderRequestClientid
3537
from whmcs_client.models.add_order_response import AddOrderResponse
3638
from whmcs_client.models.client_info import ClientInfo
3739
from whmcs_client.models.currency_info import CurrencyInfo
3840
from whmcs_client.models.get_clients_response import GetClientsResponse
3941
from whmcs_client.models.get_clients_response_all_of_clients import GetClientsResponseAllOfClients
4042
from whmcs_client.models.get_currencies_response import GetCurrenciesResponse
4143
from whmcs_client.models.get_currencies_response_all_of_currencies import GetCurrenciesResponseAllOfCurrencies
44+
from whmcs_client.models.update_client_request_clientid import UpdateClientRequestClientid
4245
from whmcs_client.models.update_client_response import UpdateClientResponse
46+
from whmcs_client.models.update_client_response_all_of_clientid import UpdateClientResponseAllOfClientid
4347
from whmcs_client.models.whmcs_base_response import WHMCSBaseResponse
4448
from whmcs_client.models.whmcs_error_response import WHMCSErrorResponse
4549
from whmcs_client.models.whmcs_success_response import WHMCSSuccessResponse

whmcs_client/api/default_api.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
from typing_extensions import Annotated
1818

1919
from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
20-
from typing import Any, Dict, List, Optional, Union
20+
from typing import Dict, List, Optional, Union
2121
from typing_extensions import Annotated
2222
from whmcs_client.models.add_client_response import AddClientResponse
23+
from whmcs_client.models.add_order_request_clientid import AddOrderRequestClientid
2324
from whmcs_client.models.add_order_response import AddOrderResponse
2425
from whmcs_client.models.get_clients_response import GetClientsResponse
2526
from whmcs_client.models.get_currencies_response import GetCurrenciesResponse
27+
from whmcs_client.models.update_client_request_clientid import UpdateClientRequestClientid
2628
from whmcs_client.models.update_client_response import UpdateClientResponse
2729

2830
from whmcs_client.api_client import ApiClient, RequestSerialized
@@ -741,7 +743,7 @@ def add_order(
741743
self,
742744
username: Annotated[StrictStr, Field(description="Admin username/API identifier")],
743745
password: Annotated[StrictStr, Field(description="Admin password/API secret")],
744-
clientid: Annotated[Optional[Any], Field(description="The ID of the client to add the order for")],
746+
clientid: AddOrderRequestClientid,
745747
paymentmethod: Annotated[StrictStr, Field(description="The payment method for the order in the system format (e.g., paypal, mailin)")],
746748
accesskey: Annotated[Optional[StrictStr], Field(description="Optional API access key")] = None,
747749
responsetype: Annotated[Optional[StrictStr], Field(description="Response format")] = None,
@@ -809,8 +811,8 @@ def add_order(
809811
:type username: str
810812
:param password: Admin password/API secret (required)
811813
:type password: str
812-
:param clientid: The ID of the client to add the order for (required)
813-
:type clientid: object
814+
:param clientid: (required)
815+
:type clientid: AddOrderRequestClientid
814816
:param paymentmethod: The payment method for the order in the system format (e.g., paypal, mailin) (required)
815817
:type paymentmethod: str
816818
:param accesskey: Optional API access key
@@ -1000,7 +1002,7 @@ def add_order_with_http_info(
10001002
self,
10011003
username: Annotated[StrictStr, Field(description="Admin username/API identifier")],
10021004
password: Annotated[StrictStr, Field(description="Admin password/API secret")],
1003-
clientid: Annotated[Optional[Any], Field(description="The ID of the client to add the order for")],
1005+
clientid: AddOrderRequestClientid,
10041006
paymentmethod: Annotated[StrictStr, Field(description="The payment method for the order in the system format (e.g., paypal, mailin)")],
10051007
accesskey: Annotated[Optional[StrictStr], Field(description="Optional API access key")] = None,
10061008
responsetype: Annotated[Optional[StrictStr], Field(description="Response format")] = None,
@@ -1068,8 +1070,8 @@ def add_order_with_http_info(
10681070
:type username: str
10691071
:param password: Admin password/API secret (required)
10701072
:type password: str
1071-
:param clientid: The ID of the client to add the order for (required)
1072-
:type clientid: object
1073+
:param clientid: (required)
1074+
:type clientid: AddOrderRequestClientid
10731075
:param paymentmethod: The payment method for the order in the system format (e.g., paypal, mailin) (required)
10741076
:type paymentmethod: str
10751077
:param accesskey: Optional API access key
@@ -1259,7 +1261,7 @@ def add_order_without_preload_content(
12591261
self,
12601262
username: Annotated[StrictStr, Field(description="Admin username/API identifier")],
12611263
password: Annotated[StrictStr, Field(description="Admin password/API secret")],
1262-
clientid: Annotated[Optional[Any], Field(description="The ID of the client to add the order for")],
1264+
clientid: AddOrderRequestClientid,
12631265
paymentmethod: Annotated[StrictStr, Field(description="The payment method for the order in the system format (e.g., paypal, mailin)")],
12641266
accesskey: Annotated[Optional[StrictStr], Field(description="Optional API access key")] = None,
12651267
responsetype: Annotated[Optional[StrictStr], Field(description="Response format")] = None,
@@ -1327,8 +1329,8 @@ def add_order_without_preload_content(
13271329
:type username: str
13281330
:param password: Admin password/API secret (required)
13291331
:type password: str
1330-
:param clientid: The ID of the client to add the order for (required)
1331-
:type clientid: object
1332+
:param clientid: (required)
1333+
:type clientid: AddOrderRequestClientid
13321334
:param paymentmethod: The payment method for the order in the system format (e.g., paypal, mailin) (required)
13331335
:type paymentmethod: str
13341336
:param accesskey: Optional API access key
@@ -2487,7 +2489,7 @@ def update_client(
24872489
self,
24882490
username: Annotated[StrictStr, Field(description="Admin username/API identifier")],
24892491
password: Annotated[StrictStr, Field(description="Admin password/API secret")],
2490-
clientid: Annotated[Optional[Any], Field(description="The ID of the client to update")],
2492+
clientid: UpdateClientRequestClientid,
24912493
accesskey: Annotated[Optional[StrictStr], Field(description="Optional API access key")] = None,
24922494
responsetype: Annotated[Optional[StrictStr], Field(description="Response format")] = None,
24932495
clientemail: Annotated[Optional[StrictStr], Field(description="The email address of the client to update")] = None,
@@ -2548,8 +2550,8 @@ def update_client(
25482550
:type username: str
25492551
:param password: Admin password/API secret (required)
25502552
:type password: str
2551-
:param clientid: The ID of the client to update (required)
2552-
:type clientid: object
2553+
:param clientid: (required)
2554+
:type clientid: UpdateClientRequestClientid
25532555
:param accesskey: Optional API access key
25542556
:type accesskey: str
25552557
:param responsetype: Response format
@@ -2718,7 +2720,7 @@ def update_client_with_http_info(
27182720
self,
27192721
username: Annotated[StrictStr, Field(description="Admin username/API identifier")],
27202722
password: Annotated[StrictStr, Field(description="Admin password/API secret")],
2721-
clientid: Annotated[Optional[Any], Field(description="The ID of the client to update")],
2723+
clientid: UpdateClientRequestClientid,
27222724
accesskey: Annotated[Optional[StrictStr], Field(description="Optional API access key")] = None,
27232725
responsetype: Annotated[Optional[StrictStr], Field(description="Response format")] = None,
27242726
clientemail: Annotated[Optional[StrictStr], Field(description="The email address of the client to update")] = None,
@@ -2779,8 +2781,8 @@ def update_client_with_http_info(
27792781
:type username: str
27802782
:param password: Admin password/API secret (required)
27812783
:type password: str
2782-
:param clientid: The ID of the client to update (required)
2783-
:type clientid: object
2784+
:param clientid: (required)
2785+
:type clientid: UpdateClientRequestClientid
27842786
:param accesskey: Optional API access key
27852787
:type accesskey: str
27862788
:param responsetype: Response format
@@ -2949,7 +2951,7 @@ def update_client_without_preload_content(
29492951
self,
29502952
username: Annotated[StrictStr, Field(description="Admin username/API identifier")],
29512953
password: Annotated[StrictStr, Field(description="Admin password/API secret")],
2952-
clientid: Annotated[Optional[Any], Field(description="The ID of the client to update")],
2954+
clientid: UpdateClientRequestClientid,
29532955
accesskey: Annotated[Optional[StrictStr], Field(description="Optional API access key")] = None,
29542956
responsetype: Annotated[Optional[StrictStr], Field(description="Response format")] = None,
29552957
clientemail: Annotated[Optional[StrictStr], Field(description="The email address of the client to update")] = None,
@@ -3010,8 +3012,8 @@ def update_client_without_preload_content(
30103012
:type username: str
30113013
:param password: Admin password/API secret (required)
30123014
:type password: str
3013-
:param clientid: The ID of the client to update (required)
3014-
:type clientid: object
3015+
:param clientid: (required)
3016+
:type clientid: UpdateClientRequestClientid
30153017
:param accesskey: Optional API access key
30163018
:type accesskey: str
30173019
:param responsetype: Response format

whmcs_client/models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@
1515

1616
# import models into model package
1717
from whmcs_client.models.add_client_response import AddClientResponse
18+
from whmcs_client.models.add_client_response_all_of_clientid import AddClientResponseAllOfClientid
19+
from whmcs_client.models.add_order_request_clientid import AddOrderRequestClientid
1820
from whmcs_client.models.add_order_response import AddOrderResponse
1921
from whmcs_client.models.client_info import ClientInfo
2022
from whmcs_client.models.currency_info import CurrencyInfo
2123
from whmcs_client.models.get_clients_response import GetClientsResponse
2224
from whmcs_client.models.get_clients_response_all_of_clients import GetClientsResponseAllOfClients
2325
from whmcs_client.models.get_currencies_response import GetCurrenciesResponse
2426
from whmcs_client.models.get_currencies_response_all_of_currencies import GetCurrenciesResponseAllOfCurrencies
27+
from whmcs_client.models.update_client_request_clientid import UpdateClientRequestClientid
2528
from whmcs_client.models.update_client_response import UpdateClientResponse
29+
from whmcs_client.models.update_client_response_all_of_clientid import UpdateClientResponseAllOfClientid
2630
from whmcs_client.models.whmcs_base_response import WHMCSBaseResponse
2731
from whmcs_client.models.whmcs_error_response import WHMCSErrorResponse
2832
from whmcs_client.models.whmcs_success_response import WHMCSSuccessResponse

0 commit comments

Comments
 (0)