Skip to content

Commit e43f462

Browse files
committed
Refactor code structure for improved readability and maintainability
1 parent 6b24e4e commit e43f462

File tree

6 files changed

+1641
-35
lines changed

6 files changed

+1641
-35
lines changed

.openapi-generator/FILES

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.github/workflows/python.yml
22
.gitignore
33
.gitlab-ci.yml
4-
.openapi-generator-ignore
54
.travis.yml
65
README.md
76
docs/AddClientRequest.md
@@ -24,17 +23,10 @@ setup.py
2423
test-requirements.txt
2524
test/__init__.py
2625
test/test_add_client_request.py
27-
test/test_add_client_response.py
2826
test/test_add_order_request.py
29-
test/test_add_order_response.py
3027
test/test_api_post_request.py
31-
test/test_default_api.py
3228
test/test_update_client_request.py
33-
test/test_update_client_response.py
3429
test/test_whmcs_base_request.py
35-
test/test_whmcs_base_response.py
36-
test/test_whmcs_error_response.py
37-
test/test_whmcs_success_response.py
3830
tox.ini
3931
whmcs_client/__init__.py
4032
whmcs_client/api/__init__.py

README.md

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,99 @@ configuration = whmcs_client.Configuration(
7575
with whmcs_client.ApiClient(configuration) as api_client:
7676
# Create an instance of the API class
7777
api_instance = whmcs_client.DefaultApi(api_client)
78-
api_post_request = whmcs_client.ApiPostRequest() # ApiPostRequest |
78+
username = 'username_example' # str | Admin username/API identifier (optional)
79+
password = 'password_example' # str | Admin password/API secret (optional)
80+
accesskey = 'accesskey_example' # str | Optional API access key (optional)
81+
responsetype = json # str | Response format (optional) (default to json)
82+
action = 'action_example' # str | Must be 'AddOrder' (optional)
83+
owner_user_id = 56 # int | The ID of the user that should own the client (optional)
84+
firstname = 'firstname_example' # str | First name of the client (optional)
85+
lastname = 'lastname_example' # str | Last name of the client (optional)
86+
companyname = 'companyname_example' # str | Company name (optional)
87+
email = 'email_example' # str | Email address of the client (optional)
88+
address1 = 'address1_example' # str | Address line 1 (optional)
89+
address2 = 'address2_example' # str | Address line 2 (optional)
90+
city = 'city_example' # str | City (optional)
91+
state = 'state_example' # str | State (optional)
92+
postcode = 'postcode_example' # str | Postal code (optional)
93+
country = 'country_example' # str | 2 character ISO country code (optional)
94+
phonenumber = 'phonenumber_example' # str | Phone number (optional)
95+
tax_id = 'tax_id_example' # str | Client's tax ID (optional)
96+
password2 = 'password2_example' # str | Password for the new user account (optional)
97+
securityqid = 56 # int | Security question ID (optional)
98+
securityqans = 'securityqans_example' # str | Security question answer (optional)
99+
currency = 56 # int | Currency ID (optional)
100+
groupid = 56 # int | Client group ID (optional)
101+
customfields = ['customfields_example'] # List[str] | Array of base64 encoded serialized array of product custom field values (optional)
102+
language = 'language_example' # str | Default language setting (optional)
103+
clientip = 'clientip_example' # str | The IP address to associate with the order (optional)
104+
notes = 'notes_example' # str | Admin only notes (optional)
105+
marketingoptin = True # bool | Opt-in to marketing emails (optional)
106+
noemail = True # bool | Set to true to suppress the Order Confirmation email being sent (optional)
107+
skipvalidation = True # bool | Ignore required field validation (optional)
108+
clientid = 56 # int | The ID of the client to add the order for (optional)
109+
clientemail = 'clientemail_example' # str | The email address of the client to update (optional)
110+
status = 'status_example' # str | The status (e.g., Active) (optional)
111+
paymentmethod = 'paymentmethod_example' # str | The payment method for the order in the system format (e.g., paypal, mailin) (optional)
112+
email_preferences_general = True # bool | Receive general emails (optional)
113+
email_preferences_product = True # bool | Receive product emails (optional)
114+
email_preferences_domain = True # bool | Receive domain emails (optional)
115+
email_preferences_invoice = True # bool | Receive invoice emails (optional)
116+
email_preferences_support = True # bool | Receive support emails (optional)
117+
email_preferences_affiliate = True # bool | Receive affiliate emails (optional)
118+
clearcreditcard = True # bool | Clear stored credit card details (optional)
119+
latefeeoveride = True # bool | Override Late Fees setting (optional)
120+
overideduenotices = True # bool | Override Overdue Notices setting (optional)
121+
taxexempt = True # bool | Exempt from tax collections (optional)
122+
separateinvoices = True # bool | Group items into one invoice (optional)
123+
disableautocc = True # bool | Enable/disable automatic credit card processing (optional)
124+
overrideautoclose = True # bool | Enable/disable automatic account closure (optional)
125+
pid = [56] # List[int] | Array of product IDs to add to the order (optional)
126+
qty = [56] # List[int] | Array of product quantities (optional)
127+
domain = ['domain_example'] # List[str] | Array of domain names associated with the products/domains (optional)
128+
billingcycle = ['billingcycle_example'] # List[str] | Array of billing cycles for the products (optional)
129+
domaintype = ['domaintype_example'] # List[str] | For domain registrations, array of register or transfer values (optional)
130+
regperiod = [56] # List[int] | For domain registrations, the registration periods for the domains (optional)
131+
idnlanguage = ['idnlanguage_example'] # List[str] | For IDN domain registrations, the language codes for the domains (optional)
132+
eppcode = ['eppcode_example'] # List[str] | For domain transfers, the EPP codes for the domains being transferred (optional)
133+
nameserver1 = 'nameserver1_example' # str | The first nameserver to apply to all domains in the order (optional)
134+
nameserver2 = 'nameserver2_example' # str | The second nameserver to apply to all domains in the order (optional)
135+
nameserver3 = 'nameserver3_example' # str | The third nameserver to apply to all domains in the order (optional)
136+
nameserver4 = 'nameserver4_example' # str | The fourth nameserver to apply to all domains in the order (optional)
137+
nameserver5 = 'nameserver5_example' # str | The fifth nameserver to apply to all domains in the order (optional)
138+
configoptions = ['configoptions_example'] # List[str] | Array of base64 encoded serialized array of product configurable options values (optional)
139+
priceoverride = [3.4] # List[float] | Override the price of the product being ordered (optional)
140+
promocode = 'promocode_example' # str | The promotion code to apply to the order (optional)
141+
promooverride = True # bool | Should the promotion apply to the order even without matching promotional products (optional)
142+
affid = 56 # int | The affiliate ID to associate with the order (optional)
143+
noinvoice = True # bool | Set to true to suppress the invoice generating for the whole order (optional)
144+
noinvoiceemail = True # bool | Set to true to suppress the Invoice Created email being sent for the order (optional)
145+
addons = ['addons_example'] # List[str] | Array of comma separated lists of addons to create on order with the products (optional)
146+
addonsqty = ['addonsqty_example'] # List[str] | Array of comma-separated lists of quantities for addons associated with products (optional)
147+
hostname = ['hostname_example'] # List[str] | Array of hostnames for VPS/Dedicated Server orders (optional)
148+
ns1prefix = ['ns1prefix_example'] # List[str] | Array of first nameserver prefixes for VPS/Dedicated servers (e.g., ns1 in ns1.hostname.com) (optional)
149+
ns2prefix = ['ns2prefix_example'] # List[str] | Array of second nameserver prefixes for VPS/Dedicated servers (e.g., ns2 in ns2.hostname.com) (optional)
150+
rootpw = ['rootpw_example'] # List[str] | Array of desired root passwords for VPS/Dedicated servers (optional)
151+
contactid = 56 # int | The ID of the contact, associated with the client, that should apply to all domains in the order (optional)
152+
dnsmanagement = [True] # List[bool] | Add DNS Management to the Domain Order (optional)
153+
domainfields = ['domainfields_example'] # List[str] | Array of base64 encoded serialized array of TLD Specific Field Values (optional)
154+
emailforwarding = [True] # List[bool] | Add Email Forwarding to the Domain Order (optional)
155+
idprotection = [True] # List[bool] | Add ID Protection to the Domain Order (optional)
156+
domainpriceoverride = [3.4] # List[float] | Override the price of the registration price on the domain being ordered (optional)
157+
domainrenewoverride = [3.4] # List[float] | Override the price of the renewal price on the domain being ordered (optional)
158+
domainrenewals = None # Dict[str, int] | A name -> value object of domainName -> renewalPeriod renewals to add an order for (optional)
159+
addonid = 56 # int | The Addon ID for an Addon Only Order (optional)
160+
addonidqty = 56 # int | The quantity of addons in an addon-only order (optional)
161+
serviceid = 56 # int | The service ID for the addon only order (optional)
162+
addonids = [56] # List[int] | Array of addon IDs for an Addon Only Order (optional)
163+
addonidsqty = [56] # List[int] | Array of quantities for an addon-only order (optional)
164+
serviceids = [56] # List[int] | Array of service IDs to associate the addons for an Addon Only order (optional)
165+
servicerenewals = [56] # List[int] | Array of service IDs to be on-demand renewed (optional)
166+
addonrenewals = [56] # List[int] | Array of service addon IDs to be on-demand renewed (optional)
79167

80168
try:
81169
# Execute WHMCS API action
82-
api_response = api_instance.api_post(api_post_request)
170+
api_response = api_instance.api_post(username=username, password=password, accesskey=accesskey, responsetype=responsetype, action=action, owner_user_id=owner_user_id, 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, marketingoptin=marketingoptin, noemail=noemail, skipvalidation=skipvalidation, clientid=clientid, clientemail=clientemail, 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, pid=pid, qty=qty, domain=domain, billingcycle=billingcycle, domaintype=domaintype, regperiod=regperiod, idnlanguage=idnlanguage, eppcode=eppcode, nameserver1=nameserver1, nameserver2=nameserver2, nameserver3=nameserver3, nameserver4=nameserver4, nameserver5=nameserver5, configoptions=configoptions, priceoverride=priceoverride, promocode=promocode, promooverride=promooverride, affid=affid, noinvoice=noinvoice, noinvoiceemail=noinvoiceemail, addons=addons, addonsqty=addonsqty, hostname=hostname, ns1prefix=ns1prefix, ns2prefix=ns2prefix, rootpw=rootpw, contactid=contactid, dnsmanagement=dnsmanagement, domainfields=domainfields, emailforwarding=emailforwarding, idprotection=idprotection, domainpriceoverride=domainpriceoverride, domainrenewoverride=domainrenewoverride, domainrenewals=domainrenewals, addonid=addonid, addonidqty=addonidqty, serviceid=serviceid, addonids=addonids, addonidsqty=addonidsqty, serviceids=serviceids, servicerenewals=servicerenewals, addonrenewals=addonrenewals)
83171
print("The response of DefaultApi->api_post:\n")
84172
pprint(api_response)
85173
except ApiException as e:

config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"packageEmail": "william@cloudoon.com",
99
"packageDescription": "Python client for WHMCS API",
1010
"generateSourceCodeOnly": false,
11-
"packageKeywords": ["whmcs", "api", "client", "billing", "hosting"]
11+
"packageKeywords": ["whmcs", "api", "client", "billing", "hosting"],
12+
"skipFormModel": false
1213
}

0 commit comments

Comments
 (0)