1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
//! Data models used throughout the crate.
//!
//! Each struct here maps to a specific cPanel/WHM API response or request body.
//! Request structs (used for create/modify operations) implement [`serde::Serialize`].
//! Response structs implement [`serde::Deserialize`].
use ;
// ═════════════════════════════════════════════════════════════════════════════
// Account models (WHM)
// ═════════════════════════════════════════════════════════════════════════════
/// Information returned by [`listaccts`](crate::CpanelClient::list_accounts) and [`getacctinfo`](crate::CpanelClient::get_account_info).
///
/// # Fields
///
/// * `username` — The account username
/// * `domain` — The primary domain
/// * `plan` — The resource plan name, if assigned
/// * `ip` — The assigned IP address
/// * `package` — Deprecated alias for `plan`
/// * `created` — Account creation timestamp
/// * `suspended` — Whether the account is currently suspended
/// * `has_root` — Whether the account has root access
/// Parameters for creating a new cPanel account via [`addacct`](crate::CpanelClient::create_account).
///
/// All fields except `username`, `password`, and `domain` are optional.
///
/// # Example
///
/// ```
/// use cpanel_rs::models::CreateAccount;
///
/// let acct = CreateAccount {
/// username: "newuser".into(),
/// password: "securepass123".into(),
/// domain: "example.com".into(),
/// plan: Some("default".into()),
/// max_sql: Some(5),
/// ..Default::default()
/// };
/// ```
/// Parameters for modifying an existing account via [`modifyacct`](crate::CpanelClient::modify_account).
///
/// # Example
///
/// ```
/// use cpanel_rs::models::ModifyAccount;
///
/// let modify = ModifyAccount {
/// username: "existinguser".into(),
/// plan: Some("premium".into()),
/// ..Default::default()
/// };
/// ```
// ═════════════════════════════════════════════════════════════════════════════
// DNS models (UAPI)
// ═════════════════════════════════════════════════════════════════════════════
/// A single DNS record as returned by [`list_zone_records`](crate::CpanelClient::list_dns_records).
///
/// # Fields
///
/// * `name` — The record name (e.g. `www`, `@`)
/// * `type_` — The record type (`A`, `AAAA`, `CNAME`, `MX`, `TXT`, etc.)
/// * `class` — The DNS class (usually `IN`)
/// * `ttl` — Time-to-live in seconds
/// * `value` — The record value (IP address, hostname, etc.)
/// Parameters for adding a DNS record via [`add_zone_record`](crate::CpanelClient::add_dns_record).
///
/// # Example
///
/// ```
/// use cpanel_rs::models::AddDnsRecord;
///
/// let record = AddDnsRecord {
/// type_: "A".into(),
/// name: "www".into(),
/// value: "1.2.3.4".into(),
/// ttl: Some(3600),
/// };
/// ```
/// A DNS zone file returned by [`export_zone`](crate::CpanelClient::export_zone).
// ═════════════════════════════════════════════════════════════════════════════
// Email models (UAPI)
// ═════════════════════════════════════════════════════════════════════════════
/// An email account as returned by [`list_popaccounts`](crate::CpanelClient::list_email_accounts).
///
/// # Fields
///
/// * `address` — The full email address
/// * `domain` — The domain
/// * `max_quota` — Maximum quota in MB (`None` = unlimited)
/// * `quota_used` — Current quota usage in MB
/// Parameters for creating an email account via [`add_popaccount`](crate::CpanelClient::create_email).
///
/// # Example
///
/// ```
/// use cpanel_rs::models::CreateEmail;
///
/// let email = CreateEmail {
/// address: "info@example.com".into(),
/// password: "securepass".into(),
/// max_quota: Some(500), // 500 MB
/// };
/// ```
/// A mail forwarder as returned by [`list_forwarders`](crate::CpanelClient::list_forwarders).
///
/// # Fields
///
/// * `address` — The source email address
/// * `destination` — Where mail is forwarded to
/// * `type_` — The forwarder type (`forward` or `catchall`)
/// Parameters for creating an autoresponder via [`add_autoresponder`](crate::CpanelClient::create_autoresponder).
///
/// # Example
///
/// ```
/// use cpanel_rs::models::CreateAutoResponder;
///
/// let ar = CreateAutoResponder {
/// email: "user@example.com".into(),
/// subject: "Out of Office".into(),
/// message: "I am currently out of the office.".into(),
/// active: Some(true),
/// ..Default::default()
/// };
/// ```
/// An autoresponder as returned by [`list_autoreponders`](crate::CpanelClient::list_autoresponders).
/// Parameters for creating a mailing list via [`add_listaccount`](crate::CpanelClient::create_mailing_list).
///
/// # Example
///
/// ```
/// use cpanel_rs::models::CreateMailingList;
///
/// let list = CreateMailingList {
/// name: "announcements".into(),
/// email: "announce@example.com".into(),
/// password: "listpass".into(),
/// description: Some("Site announcements".into()),
/// moderated: Some(true),
/// };
/// ```
/// A mailing list as returned by [`list_listaccounts`](crate::CpanelClient::list_mailing_lists).
// ═════════════════════════════════════════════════════════════════════════════
// Database models (UAPI)
// ═════════════════════════════════════════════════════════════════════════════
/// A MySQL database as returned by [`list_dbs`](crate::CpanelClient::list_databases).
///
/// # Fields
///
/// * `name` — The database name (prefixed with the cPanel username, e.g. `user_db`)
/// * `size` — Size in MB
/// * `charset` — The character set
/// Parameters for creating a database via [`create_db`](crate::CpanelClient::create_database).
///
/// # Example
///
/// ```
/// use cpanel_rs::models::CreateDatabase;
///
/// let db = CreateDatabase {
/// name: "myapp".into(),
/// charset: Some("utf8mb4".into()),
/// };
/// ```
/// A privilege assignment as returned by [`list_user_privileges`](crate::CpanelClient::list_db_user_privileges).
// ═════════════════════════════════════════════════════════════════════════════
// File Manager models (UAPI)
// ═════════════════════════════════════════════════════════════════════════════
/// A file or directory entry as returned by [`listdir`](crate::CpanelClient::list_files).
///
/// # Fields
///
/// * `name` — The file/directory name
/// * `type_` — `"file"` or `"dir"`
/// * `size` — File size in bytes (directories report total size)
/// * `mode` — Unix permission string (e.g. `0755`)
/// * `mtime` — Last modification time
/// * `path` — Full path to the entry
/// Parameters for creating a file via [`create_file`](crate::CpanelClient::create_file).
///
/// # Example
///
/// ```
/// use cpanel_rs::models::CreateFile;
///
/// let file = CreateFile {
/// path: "/public_html/index.html".into(),
/// content: Some("<h1>Hello</h1>".into()),
/// overwrite: false,
/// };
/// ```
/// Parameters for renaming a file via [`rename`](crate::CpanelClient::rename_file).
///
/// # Example
///
/// ```
/// use cpanel_rs::models::RenameFile;
///
/// let rename = RenameFile {
/// source: "/public_html/old.txt".into(),
/// destination: "/public_html/new.txt".into(),
/// };
/// ```
/// Parameters for creating a directory via [`mkdir`](crate::CpanelClient::mkdir).
///
/// # Example
///
/// ```
/// use cpanel_rs::models::CreateDir;
///
/// let dir = CreateDir {
/// path: "/public_html/assets".into(),
/// };
/// ```
/// Parameters for compressing files via [`compress`](crate::CpanelClient::compress).
///
/// # Example
///
/// ```
/// use cpanel_rs::models::CompressFiles;
///
/// let compress = CompressFiles {
/// paths: vec!["/home/user/public_html/wp-content/uploads".into()],
/// archive_name: "uploads_backup.zip".into(),
/// };
/// ```
// ═════════════════════════════════════════════════════════════════════════════
// SSL models (UAPI)
// ═════════════════════════════════════════════════════════════════════════════
/// An SSL certificate as returned by [`get_cert_info`](crate::CpanelClient::list_ssl_certs).
///
/// # Fields
///
/// * `domain` — The domain the certificate is for
/// * `issuer` — Certificate issuer
/// * `subject` — Certificate subject
/// * `not_before` — Not-before date
/// * `not_after` — Expiry date
/// * `active` — Whether the certificate is active
/// Parameters for installing an SSL certificate via [`install_cert`](crate::CpanelClient::install_ssl).
///
/// # Example
///
/// ```
/// use cpanel_rs::models::InstallSsl;
///
/// let install = InstallSsl {
/// domain: "example.com".into(),
/// csr: "-----BEGIN CERTIFICATE REQUEST-----...".into(),
/// cert: "-----BEGIN CERTIFICATE-----...".into(),
/// ca: Some("-----BEGIN CERTIFICATE-----...".into()),
/// bundle: Some(true),
/// };
/// ```
// ═════════════════════════════════════════════════════════════════════════════
// Backup models (UAPI)
// ═════════════════════════════════════════════════════════════════════════════
/// Backup configuration/info as returned by [`get_config`](crate::CpanelClient::get_backup_info).
///
/// # Fields
///
/// * `location` — Backup storage location
/// * `last_backup` — Timestamp of the last backup
/// * `size` — Total backup size
/// * `incremental` — Whether incremental backups are enabled
/// Parameters for creating a backup via [`create_backup`](crate::CpanelClient::create_backup).
///
/// # Example
///
/// ```
/// use cpanel_rs::models::CreateBackup;
///
/// let backup = CreateBackup {
/// full: Some(true), // full backup
/// location: Some("remote".into()), // remote storage
/// email: Some("admin@example.com".into()),
/// };
/// ```
/// Backup schedule configuration as returned by [`get_config`](crate::CpanelClient::get_backup_schedule)
/// and set via [`configure_backups`](crate::CpanelClient::set_backup_schedule).
///
/// # Fields
///
/// * `frequency` — Backup frequency (`daily`, `weekly`, `monthly`)
/// * `day_of_week` — Day of week for weekly backups (0–6)
/// * `day_of_month` — Day of month for monthly backups (1–28)
/// * `hour` — Hour of day for the backup (0–23)
/// * `email` — Notification email
// ═════════════════════════════════════════════════════════════════════════════
// Resource usage models (UAPI)
// ═════════════════════════════════════════════════════════════════════════════
/// Detailed resource usage for a cPanel account as returned by [`get_quota`](crate::CpanelClient::get_user_quota).
///
/// # Fields
///
/// * `disk_used` — Disk space used in MB
/// * `disk_quota` — Disk quota in MB (`-1` = unlimited)
/// * `inode_used` — Inodes used
/// * `inode_quota` — Inode quota (`-1` = unlimited)
/// * `bandwidth_used` — Bandwidth used in MB
/// * `bandwidth_quota` — Bandwidth quota in MB
/// * `cpu_percent` — Current CPU usage percentage
/// A PHP version handler as returned by [`list_versions`](crate::CpanelClient::list_php_versions).
///
/// # Fields
///
/// * `handler` — The SAPI handler (e.g. `php-fpm`, `proxy-php`)
/// * `version` — PHP version string (e.g. `8.1`)
/// * `default` — Whether this is the default version
// ═════════════════════════════════════════════════════════════════════════════
// Cron Job models (UAPI)
// ═════════════════════════════════════════════════════════════════════════════
/// A cron job as returned by [`list_cron_jobs`](crate::CpanelClient::list_cron_jobs).
/// Parameters for adding a cron job via [`add_cron_job`](crate::CpanelClient::add_cron_job).
/// Parameters for editing a cron job via [`edit_cron_job`](crate::CpanelClient::edit_cron_job).
///
/// All fields except `job` are optional; only the provided fields will be updated.
// ═════════════════════════════════════════════════════════════════════════════
// Domain & Subdomain models (UAPI)
// ═════════════════════════════════════════════════════════════════════════════
/// An addon domain as returned by [`list_addon_domains`](crate::CpanelClient::list_addon_domains).
/// Parameters for adding an addon domain via [`create_addon_domain`](crate::CpanelClient::create_addon_domain).
/// A subdomain as returned by [`list_subdomains`](crate::CpanelClient::list_subdomains).
/// Parameters for adding a subdomain via [`create_subdomain`](crate::CpanelClient::create_subdomain).
// ═════════════════════════════════════════════════════════════════════════════
// FTP Account models (UAPI)
// ═════════════════════════════════════════════════════════════════════════════
/// An FTP account as returned by [`list_ftp_accounts`](crate::CpanelClient::list_ftp_accounts).
/// Parameters for creating an FTP account via [`create_ftp_account`](crate::CpanelClient::create_ftp_account).
/// Parameters for modifying an FTP account via [`modify_ftp_account`](crate::CpanelClient::modify_ftp_account).
///
/// Only non-`None` fields will be updated.
// ═════════════════════════════════════════════════════════════════════════════
// Security models (UAPI)
// ═════════════════════════════════════════════════════════════════════════════
/// A blocked IP entry as returned by [`list_ip_blocks`](crate::CpanelClient::list_ip_blocks).
/// A ModSecurity rule as returned by [`list_modsec_rules`](crate::CpanelClient::list_modsec_rules).