Skip to content

Commit 7360942

Browse files
committed
Refactor WHMCSBaseRequest model by removing unused properties and updating required fields
1 parent eca87ee commit 7360942

3 files changed

Lines changed: 21 additions & 116 deletions

File tree

docs/WHMCSBaseRequest.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**action** | **str** | The WHMCS API action to perform |
7-
**identifier** | **str** | API Identifier (alternative to username/password) | [optional]
8-
**secret** | **str** | API Secret (alternative to username/password) | [optional]
9-
**username** | **str** | Admin username (alternative to identifier/secret) | [optional]
10-
**password** | **str** | Admin password (alternative to identifier/secret) | [optional]
11-
**accesskey** | **str** | Optional API access key for additional security | [optional]
6+
**username** | **str** | Admin username/API identifier |
7+
**password** | **str** | Admin password/API secret |
8+
**accesskey** | **str** | Optional API access key | [optional]
129
**responsetype** | **str** | Response format | [optional] [default to 'json']
1310

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

openapi.yaml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,27 +85,18 @@ components:
8585
WHMCSBaseRequest:
8686
type: object
8787
required:
88-
- action
88+
- username
89+
- password
8990
properties:
90-
action:
91-
type: string
92-
description: The WHMCS API action to perform
93-
identifier:
94-
type: string
95-
description: API Identifier (alternative to username/password)
96-
secret:
97-
type: string
98-
description: API Secret (alternative to username/password)
9991
username:
10092
type: string
101-
description: Admin username (alternative to identifier/secret)
102-
93+
description: Admin username/API identifier
10394
password:
10495
type: string
105-
description: Admin password (alternative to identifier/secret)
96+
description: Admin password/API secret
10697
accesskey:
10798
type: string
108-
description: Optional API access key for additional security
99+
description: Optional API access key
109100
responsetype:
110101
type: string
111102
enum: [json, xml]

whmcs_client/models/whmcs_base_request.py

Lines changed: 13 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -28,125 +28,38 @@ class WHMCSBaseRequest(object):
2828
and the value is json key in definition.
2929
"""
3030
swagger_types = {
31-
'action': 'str',
32-
'identifier': 'str',
33-
'secret': 'str',
3431
'username': 'str',
3532
'password': 'str',
3633
'accesskey': 'str',
3734
'responsetype': 'str'
3835
}
3936

4037
attribute_map = {
41-
'action': 'action',
42-
'identifier': 'identifier',
43-
'secret': 'secret',
4438
'username': 'username',
4539
'password': 'password',
4640
'accesskey': 'accesskey',
4741
'responsetype': 'responsetype'
4842
}
4943

50-
def __init__(self, action=None, identifier=None, secret=None, username=None, password=None, accesskey=None, responsetype='json'): # noqa: E501
44+
def __init__(self, username=None, password=None, accesskey=None, responsetype='json'): # noqa: E501
5145
"""WHMCSBaseRequest - a model defined in Swagger""" # noqa: E501
52-
self._action = None
53-
self._identifier = None
54-
self._secret = None
5546
self._username = None
5647
self._password = None
5748
self._accesskey = None
5849
self._responsetype = None
5950
self.discriminator = None
60-
self.action = action
61-
if identifier is not None:
62-
self.identifier = identifier
63-
if secret is not None:
64-
self.secret = secret
65-
if username is not None:
66-
self.username = username
67-
if password is not None:
68-
self.password = password
51+
self.username = username
52+
self.password = password
6953
if accesskey is not None:
7054
self.accesskey = accesskey
7155
if responsetype is not None:
7256
self.responsetype = responsetype
7357

74-
@property
75-
def action(self):
76-
"""Gets the action of this WHMCSBaseRequest. # noqa: E501
77-
78-
The WHMCS API action to perform # noqa: E501
79-
80-
:return: The action of this WHMCSBaseRequest. # noqa: E501
81-
:rtype: str
82-
"""
83-
return self._action
84-
85-
@action.setter
86-
def action(self, action):
87-
"""Sets the action of this WHMCSBaseRequest.
88-
89-
The WHMCS API action to perform # noqa: E501
90-
91-
:param action: The action of this WHMCSBaseRequest. # noqa: E501
92-
:type: str
93-
"""
94-
if action is None:
95-
raise ValueError("Invalid value for `action`, must not be `None`") # noqa: E501
96-
97-
self._action = action
98-
99-
@property
100-
def identifier(self):
101-
"""Gets the identifier of this WHMCSBaseRequest. # noqa: E501
102-
103-
API Identifier (alternative to username/password) # noqa: E501
104-
105-
:return: The identifier of this WHMCSBaseRequest. # noqa: E501
106-
:rtype: str
107-
"""
108-
return self._identifier
109-
110-
@identifier.setter
111-
def identifier(self, identifier):
112-
"""Sets the identifier of this WHMCSBaseRequest.
113-
114-
API Identifier (alternative to username/password) # noqa: E501
115-
116-
:param identifier: The identifier of this WHMCSBaseRequest. # noqa: E501
117-
:type: str
118-
"""
119-
120-
self._identifier = identifier
121-
122-
@property
123-
def secret(self):
124-
"""Gets the secret of this WHMCSBaseRequest. # noqa: E501
125-
126-
API Secret (alternative to username/password) # noqa: E501
127-
128-
:return: The secret of this WHMCSBaseRequest. # noqa: E501
129-
:rtype: str
130-
"""
131-
return self._secret
132-
133-
@secret.setter
134-
def secret(self, secret):
135-
"""Sets the secret of this WHMCSBaseRequest.
136-
137-
API Secret (alternative to username/password) # noqa: E501
138-
139-
:param secret: The secret of this WHMCSBaseRequest. # noqa: E501
140-
:type: str
141-
"""
142-
143-
self._secret = secret
144-
14558
@property
14659
def username(self):
14760
"""Gets the username of this WHMCSBaseRequest. # noqa: E501
14861
149-
Admin username (alternative to identifier/secret) # noqa: E501
62+
Admin username/API identifier # noqa: E501
15063
15164
:return: The username of this WHMCSBaseRequest. # noqa: E501
15265
:rtype: str
@@ -157,19 +70,21 @@ def username(self):
15770
def username(self, username):
15871
"""Sets the username of this WHMCSBaseRequest.
15972
160-
Admin username (alternative to identifier/secret) # noqa: E501
73+
Admin username/API identifier # noqa: E501
16174
16275
:param username: The username of this WHMCSBaseRequest. # noqa: E501
16376
:type: str
16477
"""
78+
if username is None:
79+
raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501
16580

16681
self._username = username
16782

16883
@property
16984
def password(self):
17085
"""Gets the password of this WHMCSBaseRequest. # noqa: E501
17186
172-
Admin password (alternative to identifier/secret) # noqa: E501
87+
Admin password/API secret # noqa: E501
17388
17489
:return: The password of this WHMCSBaseRequest. # noqa: E501
17590
:rtype: str
@@ -180,19 +95,21 @@ def password(self):
18095
def password(self, password):
18196
"""Sets the password of this WHMCSBaseRequest.
18297
183-
Admin password (alternative to identifier/secret) # noqa: E501
98+
Admin password/API secret # noqa: E501
18499
185100
:param password: The password of this WHMCSBaseRequest. # noqa: E501
186101
:type: str
187102
"""
103+
if password is None:
104+
raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501
188105

189106
self._password = password
190107

191108
@property
192109
def accesskey(self):
193110
"""Gets the accesskey of this WHMCSBaseRequest. # noqa: E501
194111
195-
Optional API access key for additional security # noqa: E501
112+
Optional API access key # noqa: E501
196113
197114
:return: The accesskey of this WHMCSBaseRequest. # noqa: E501
198115
:rtype: str
@@ -203,7 +120,7 @@ def accesskey(self):
203120
def accesskey(self, accesskey):
204121
"""Sets the accesskey of this WHMCSBaseRequest.
205122
206-
Optional API access key for additional security # noqa: E501
123+
Optional API access key # noqa: E501
207124
208125
:param accesskey: The accesskey of this WHMCSBaseRequest. # noqa: E501
209126
:type: str

0 commit comments

Comments
 (0)