Refactor type generator
* Allows for generating top-level types for any embedded struct so
that sub-types can be properly instantiated from calling code
* Specifying `-no-embedded-types` will generate top-level types
rather than embedding the struct
* Refactored "Device" API
* All fields set to `omitempty` because it describes all possible
device types, so effectively any field could be omitted any time
* Fixed `get` call for "Device" API; replacing `rest` with `stat`
* Generated `get` and `update` calls for `Setting*` APIs
* Added `5.14.23` JSON files
This commit is contained in:
committed by
Paul Tyng
parent
79542b4006
commit
35eda4f67b
@@ -23,6 +23,8 @@ type User struct {
|
||||
NoDelete bool `json:"attr_no_delete,omitempty"`
|
||||
NoEdit bool `json:"attr_no_edit,omitempty"`
|
||||
|
||||
IP string `json:"ip,omitempty"` // non-generated field
|
||||
|
||||
Blocked bool `json:"blocked,omitempty"`
|
||||
FixedIP string `json:"fixed_ip,omitempty"`
|
||||
Hostname string `json:"hostname,omitempty"`
|
||||
@@ -33,8 +35,6 @@ type User struct {
|
||||
Note string `json:"note,omitempty"`
|
||||
UseFixedIP bool `json:"use_fixedip"`
|
||||
UserGroupID string `json:"usergroup_id"`
|
||||
// non-generated fields
|
||||
IP string `json:"ip,omitempty"`
|
||||
}
|
||||
|
||||
func (c *Client) listUser(ctx context.Context, site string) ([]User, error) {
|
||||
|
||||
Reference in New Issue
Block a user