From b034091baba5977a06ea2f1470fa3ef7ac67c7c4 Mon Sep 17 00:00:00 2001 From: Joey Berkovitz Date: Sat, 5 Aug 2023 21:38:19 -0400 Subject: [PATCH] api improvements to support new resources --- netbox/models/circuit_termination.go | 4 +- netbox/models/console_port.go | 8 +- netbox/models/console_server_port.go | 8 +- netbox/models/front_port.go | 4 +- netbox/models/interface.go | 8 +- netbox/models/inventory_item_role.go | 2 +- netbox/models/power_feed.go | 8 +- netbox/models/power_outlet.go | 8 +- netbox/models/power_port.go | 8 +- netbox/models/rear_port.go | 4 +- netbox/models/writable_cable.go | 8 +- netbox/models/writable_circuit_termination.go | 4 +- netbox/models/writable_console_port.go | 16 +- netbox/models/writable_console_server_port.go | 16 +- netbox/models/writable_front_port.go | 10 +- netbox/models/writable_interface.go | 8 +- netbox/models/writable_inventory_item.go | 14 +- netbox/models/writable_module.go | 2 +- netbox/models/writable_module_type.go | 4 +- netbox/models/writable_power_feed.go | 14 +- netbox/models/writable_power_outlet.go | 18 +- netbox/models/writable_power_panel.go | 2 +- netbox/models/writable_power_port.go | 18 +- netbox/models/writable_rear_port.go | 10 +- preprocess.py | 82 ++++-- swagger.processed.json | 237 +++++++++++------- 26 files changed, 313 insertions(+), 212 deletions(-) diff --git a/netbox/models/circuit_termination.go b/netbox/models/circuit_termination.go index c25ce8fba4..6d093ab4d0 100644 --- a/netbox/models/circuit_termination.go +++ b/netbox/models/circuit_termination.go @@ -81,7 +81,7 @@ type CircuitTermination struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -618,7 +618,7 @@ func (m *CircuitTermination) contextValidateLastUpdated(ctx context.Context, for func (m *CircuitTermination) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/console_port.go b/netbox/models/console_port.go index 4cbabfcdd2..e3e64d74eb 100644 --- a/netbox/models/console_port.go +++ b/netbox/models/console_port.go @@ -52,7 +52,7 @@ type ConsolePort struct { // Return the appropriate serializer for the type of connected object. // // Read Only: true - ConnectedEndpoints []*string `json:"connected_endpoints"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` // Connected endpoints reachable // Read Only: true @@ -101,7 +101,7 @@ type ConsolePort struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -527,7 +527,7 @@ func (m *ConsolePort) contextValidateCableEnd(ctx context.Context, formats strfm func (m *ConsolePort) contextValidateConnectedEndpoints(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []*string(m.ConnectedEndpoints)); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []interface{}(m.ConnectedEndpoints)); err != nil { return err } @@ -606,7 +606,7 @@ func (m *ConsolePort) contextValidateLastUpdated(ctx context.Context, formats st func (m *ConsolePort) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/console_server_port.go b/netbox/models/console_server_port.go index 28d0ad818a..b66698e230 100644 --- a/netbox/models/console_server_port.go +++ b/netbox/models/console_server_port.go @@ -52,7 +52,7 @@ type ConsoleServerPort struct { // Return the appropriate serializer for the type of connected object. // // Read Only: true - ConnectedEndpoints []*string `json:"connected_endpoints"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` // Connected endpoints reachable // Read Only: true @@ -101,7 +101,7 @@ type ConsoleServerPort struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -527,7 +527,7 @@ func (m *ConsoleServerPort) contextValidateCableEnd(ctx context.Context, formats func (m *ConsoleServerPort) contextValidateConnectedEndpoints(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []*string(m.ConnectedEndpoints)); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []interface{}(m.ConnectedEndpoints)); err != nil { return err } @@ -606,7 +606,7 @@ func (m *ConsoleServerPort) contextValidateLastUpdated(ctx context.Context, form func (m *ConsoleServerPort) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/front_port.go b/netbox/models/front_port.go index a8e399ec9b..70557c7f1e 100644 --- a/netbox/models/front_port.go +++ b/netbox/models/front_port.go @@ -92,7 +92,7 @@ type FrontPort struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -607,7 +607,7 @@ func (m *FrontPort) contextValidateLastUpdated(ctx context.Context, formats strf func (m *FrontPort) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/interface.go b/netbox/models/interface.go index 5041975862..4401925591 100644 --- a/netbox/models/interface.go +++ b/netbox/models/interface.go @@ -55,7 +55,7 @@ type Interface struct { // Return the appropriate serializer for the type of connected object. // // Read Only: true - ConnectedEndpoints []*string `json:"connected_endpoints"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` // Connected endpoints reachable // Read Only: true @@ -124,7 +124,7 @@ type Interface struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -1144,7 +1144,7 @@ func (m *Interface) contextValidateCableEnd(ctx context.Context, formats strfmt. func (m *Interface) contextValidateConnectedEndpoints(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []*string(m.ConnectedEndpoints)); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []interface{}(m.ConnectedEndpoints)); err != nil { return err } @@ -1289,7 +1289,7 @@ func (m *Interface) contextValidateLastUpdated(ctx context.Context, formats strf func (m *Interface) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/inventory_item_role.go b/netbox/models/inventory_item_role.go index 3a7dfb00d6..52b482e11e 100644 --- a/netbox/models/inventory_item_role.go +++ b/netbox/models/inventory_item_role.go @@ -39,7 +39,7 @@ type InventoryItemRole struct { // Max Length: 6 // Min Length: 1 // Pattern: ^[0-9a-f]{6}$ - Color string `json:"color,omitempty"` + Color string `json:"color"` // Created // Read Only: true diff --git a/netbox/models/power_feed.go b/netbox/models/power_feed.go index a7440d9220..a236f6ee89 100644 --- a/netbox/models/power_feed.go +++ b/netbox/models/power_feed.go @@ -60,7 +60,7 @@ type PowerFeed struct { // Return the appropriate serializer for the type of connected object. // // Read Only: true - ConnectedEndpoints []*string `json:"connected_endpoints"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` // Connected endpoints reachable // Read Only: true @@ -99,7 +99,7 @@ type PowerFeed struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -645,7 +645,7 @@ func (m *PowerFeed) contextValidateCableEnd(ctx context.Context, formats strfmt. func (m *PowerFeed) contextValidateConnectedEndpoints(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []*string(m.ConnectedEndpoints)); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []interface{}(m.ConnectedEndpoints)); err != nil { return err } @@ -708,7 +708,7 @@ func (m *PowerFeed) contextValidateLastUpdated(ctx context.Context, formats strf func (m *PowerFeed) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/power_outlet.go b/netbox/models/power_outlet.go index b6c56e9d34..b61399727f 100644 --- a/netbox/models/power_outlet.go +++ b/netbox/models/power_outlet.go @@ -52,7 +52,7 @@ type PowerOutlet struct { // Return the appropriate serializer for the type of connected object. // // Read Only: true - ConnectedEndpoints []*string `json:"connected_endpoints"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` // Connected endpoints reachable // Read Only: true @@ -104,7 +104,7 @@ type PowerOutlet struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -557,7 +557,7 @@ func (m *PowerOutlet) contextValidateCableEnd(ctx context.Context, formats strfm func (m *PowerOutlet) contextValidateConnectedEndpoints(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []*string(m.ConnectedEndpoints)); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []interface{}(m.ConnectedEndpoints)); err != nil { return err } @@ -652,7 +652,7 @@ func (m *PowerOutlet) contextValidateLastUpdated(ctx context.Context, formats st func (m *PowerOutlet) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/power_port.go b/netbox/models/power_port.go index 8effbbb074..46f067acf2 100644 --- a/netbox/models/power_port.go +++ b/netbox/models/power_port.go @@ -59,7 +59,7 @@ type PowerPort struct { // Return the appropriate serializer for the type of connected object. // // Read Only: true - ConnectedEndpoints []*string `json:"connected_endpoints"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` // Connected endpoints reachable // Read Only: true @@ -108,7 +108,7 @@ type PowerPort struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -551,7 +551,7 @@ func (m *PowerPort) contextValidateCableEnd(ctx context.Context, formats strfmt. func (m *PowerPort) contextValidateConnectedEndpoints(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []*string(m.ConnectedEndpoints)); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []interface{}(m.ConnectedEndpoints)); err != nil { return err } @@ -630,7 +630,7 @@ func (m *PowerPort) contextValidateLastUpdated(ctx context.Context, formats strf func (m *PowerPort) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/rear_port.go b/netbox/models/rear_port.go index ac01e9e561..a935518cb8 100644 --- a/netbox/models/rear_port.go +++ b/netbox/models/rear_port.go @@ -92,7 +92,7 @@ type RearPort struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -575,7 +575,7 @@ func (m *RearPort) contextValidateLastUpdated(ctx context.Context, formats strfm func (m *RearPort) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/writable_cable.go b/netbox/models/writable_cable.go index 8f8c70d1ef..a38e5aeda2 100644 --- a/netbox/models/writable_cable.go +++ b/netbox/models/writable_cable.go @@ -45,7 +45,7 @@ type WritableCable struct { // Color // Max Length: 6 // Pattern: ^[0-9a-f]{6}$ - Color string `json:"color,omitempty"` + Color string `json:"color"` // Comments Comments string `json:"comments,omitempty"` @@ -80,7 +80,7 @@ type WritableCable struct { LastUpdated *strfmt.DateTime `json:"last_updated,omitempty"` // Length - Length *float64 `json:"length,omitempty"` + Length *float64 `json:"length"` // Length unit // Enum: [km m cm mi ft in] @@ -94,11 +94,11 @@ type WritableCable struct { Tags []*NestedTag `json:"tags"` // Tenant - Tenant *int64 `json:"tenant,omitempty"` + Tenant *int64 `json:"tenant"` // Type // Enum: [cat3 cat5 cat5e cat6 cat6a cat7 cat7a cat8 dac-active dac-passive mrj21-trunk coaxial mmf mmf-om1 mmf-om2 mmf-om3 mmf-om4 mmf-om5 smf smf-os1 smf-os2 aoc power] - Type string `json:"type,omitempty"` + Type string `json:"type"` // Url // Read Only: true diff --git a/netbox/models/writable_circuit_termination.go b/netbox/models/writable_circuit_termination.go index 70ccaa96f6..d872e9ade1 100644 --- a/netbox/models/writable_circuit_termination.go +++ b/netbox/models/writable_circuit_termination.go @@ -81,7 +81,7 @@ type WritableCircuitTermination struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -533,7 +533,7 @@ func (m *WritableCircuitTermination) contextValidateLastUpdated(ctx context.Cont func (m *WritableCircuitTermination) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/writable_console_port.go b/netbox/models/writable_console_port.go index c8fca89cc5..794db83371 100644 --- a/netbox/models/writable_console_port.go +++ b/netbox/models/writable_console_port.go @@ -52,7 +52,7 @@ type WritableConsolePort struct { // Return the appropriate serializer for the type of connected object. // // Read Only: true - ConnectedEndpoints []*string `json:"connected_endpoints"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` // Connected endpoints reachable // Read Only: true @@ -101,7 +101,7 @@ type WritableConsolePort struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -110,10 +110,10 @@ type WritableConsolePort struct { // Mark connected // // Treat as if a cable is connected - MarkConnected bool `json:"mark_connected,omitempty"` + MarkConnected bool `json:"mark_connected"` // Module - Module *int64 `json:"module,omitempty"` + Module *int64 `json:"module"` // Name // Required: true @@ -125,7 +125,7 @@ type WritableConsolePort struct { // // Port speed in bits per second // Enum: [1200 2400 4800 9600 19200 38400 57600 115200] - Speed *int64 `json:"speed,omitempty"` + Speed *int64 `json:"speed"` // tags Tags []*NestedTag `json:"tags"` @@ -134,7 +134,7 @@ type WritableConsolePort struct { // // Physical port type // Enum: [de-9 db-25 rj-11 rj-12 rj-45 mini-din-8 usb-a usb-b usb-c usb-mini-a usb-mini-b usb-micro-a usb-micro-b usb-micro-ab other] - Type string `json:"type,omitempty"` + Type string `json:"type"` // Url // Read Only: true @@ -559,7 +559,7 @@ func (m *WritableConsolePort) contextValidateCableEnd(ctx context.Context, forma func (m *WritableConsolePort) contextValidateConnectedEndpoints(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []*string(m.ConnectedEndpoints)); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []interface{}(m.ConnectedEndpoints)); err != nil { return err } @@ -622,7 +622,7 @@ func (m *WritableConsolePort) contextValidateLastUpdated(ctx context.Context, fo func (m *WritableConsolePort) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/writable_console_server_port.go b/netbox/models/writable_console_server_port.go index f63cc587da..833ffa8345 100644 --- a/netbox/models/writable_console_server_port.go +++ b/netbox/models/writable_console_server_port.go @@ -52,7 +52,7 @@ type WritableConsoleServerPort struct { // Return the appropriate serializer for the type of connected object. // // Read Only: true - ConnectedEndpoints []*string `json:"connected_endpoints"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` // Connected endpoints reachable // Read Only: true @@ -101,7 +101,7 @@ type WritableConsoleServerPort struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -110,10 +110,10 @@ type WritableConsoleServerPort struct { // Mark connected // // Treat as if a cable is connected - MarkConnected bool `json:"mark_connected,omitempty"` + MarkConnected bool `json:"mark_connected"` // Module - Module *int64 `json:"module,omitempty"` + Module *int64 `json:"module"` // Name // Required: true @@ -125,7 +125,7 @@ type WritableConsoleServerPort struct { // // Port speed in bits per second // Enum: [1200 2400 4800 9600 19200 38400 57600 115200] - Speed *int64 `json:"speed,omitempty"` + Speed *int64 `json:"speed"` // tags Tags []*NestedTag `json:"tags"` @@ -134,7 +134,7 @@ type WritableConsoleServerPort struct { // // Physical port type // Enum: [de-9 db-25 rj-11 rj-12 rj-45 mini-din-8 usb-a usb-b usb-c usb-mini-a usb-mini-b usb-micro-a usb-micro-b usb-micro-ab other] - Type string `json:"type,omitempty"` + Type string `json:"type"` // Url // Read Only: true @@ -559,7 +559,7 @@ func (m *WritableConsoleServerPort) contextValidateCableEnd(ctx context.Context, func (m *WritableConsoleServerPort) contextValidateConnectedEndpoints(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []*string(m.ConnectedEndpoints)); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []interface{}(m.ConnectedEndpoints)); err != nil { return err } @@ -622,7 +622,7 @@ func (m *WritableConsoleServerPort) contextValidateLastUpdated(ctx context.Conte func (m *WritableConsoleServerPort) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/writable_front_port.go b/netbox/models/writable_front_port.go index a9e589c8ef..2782ff96aa 100644 --- a/netbox/models/writable_front_port.go +++ b/netbox/models/writable_front_port.go @@ -51,7 +51,7 @@ type WritableFrontPort struct { // Color // Max Length: 6 // Pattern: ^[0-9a-f]{6}$ - Color string `json:"color,omitempty"` + Color string `json:"color"` // Created // Read Only: true @@ -92,7 +92,7 @@ type WritableFrontPort struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -101,10 +101,10 @@ type WritableFrontPort struct { // Mark connected // // Treat as if a cable is connected - MarkConnected bool `json:"mark_connected,omitempty"` + MarkConnected bool `json:"mark_connected"` // Module - Module *int64 `json:"module,omitempty"` + Module *int64 `json:"module"` // Name // Required: true @@ -677,7 +677,7 @@ func (m *WritableFrontPort) contextValidateLastUpdated(ctx context.Context, form func (m *WritableFrontPort) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/writable_interface.go b/netbox/models/writable_interface.go index 1628b14d8c..3d346c4e1d 100644 --- a/netbox/models/writable_interface.go +++ b/netbox/models/writable_interface.go @@ -55,7 +55,7 @@ type WritableInterface struct { // Return the appropriate serializer for the type of connected object. // // Read Only: true - ConnectedEndpoints []*string `json:"connected_endpoints"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` // Connected endpoints reachable // Read Only: true @@ -126,7 +126,7 @@ type WritableInterface struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -1899,7 +1899,7 @@ func (m *WritableInterface) contextValidateCableEnd(ctx context.Context, formats func (m *WritableInterface) contextValidateConnectedEndpoints(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []*string(m.ConnectedEndpoints)); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []interface{}(m.ConnectedEndpoints)); err != nil { return err } @@ -1989,7 +1989,7 @@ func (m *WritableInterface) contextValidateLastUpdated(ctx context.Context, form func (m *WritableInterface) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/writable_inventory_item.go b/netbox/models/writable_inventory_item.go index 4e30e9dd22..7e8582bb35 100644 --- a/netbox/models/writable_inventory_item.go +++ b/netbox/models/writable_inventory_item.go @@ -43,7 +43,7 @@ type WritableInventoryItem struct { // // A unique tag used to identify this item // Max Length: 50 - AssetTag *string `json:"asset_tag,omitempty"` + AssetTag *string `json:"asset_tag"` // Component // Read Only: true @@ -51,10 +51,10 @@ type WritableInventoryItem struct { // Component id // Minimum: 0 - ComponentID *int64 `json:"component_id,omitempty"` + ComponentID *int64 `json:"component_id"` // Component type - ComponentType *string `json:"component_type,omitempty"` + ComponentType *string `json:"component_type"` // Created // Read Only: true @@ -75,7 +75,7 @@ type WritableInventoryItem struct { // Discovered // // This item was automatically discovered - Discovered bool `json:"discovered,omitempty"` + Discovered bool `json:"discovered"` // Display // Read Only: true @@ -97,7 +97,7 @@ type WritableInventoryItem struct { LastUpdated *strfmt.DateTime `json:"last_updated,omitempty"` // Manufacturer - Manufacturer *int64 `json:"manufacturer,omitempty"` + Manufacturer *int64 `json:"manufacturer"` // Name // Required: true @@ -106,7 +106,7 @@ type WritableInventoryItem struct { Name *string `json:"name"` // Parent - Parent *int64 `json:"parent,omitempty"` + Parent *int64 `json:"parent"` // Part ID // @@ -115,7 +115,7 @@ type WritableInventoryItem struct { PartID string `json:"part_id,omitempty"` // Role - Role *int64 `json:"role,omitempty"` + Role *int64 `json:"role"` // Serial number // Max Length: 50 diff --git a/netbox/models/writable_module.go b/netbox/models/writable_module.go index 251c1dc852..992a74d715 100644 --- a/netbox/models/writable_module.go +++ b/netbox/models/writable_module.go @@ -40,7 +40,7 @@ type WritableModule struct { // // A unique tag used to identify this device // Max Length: 50 - AssetTag *string `json:"asset_tag,omitempty"` + AssetTag *string `json:"asset_tag"` // Comments Comments string `json:"comments,omitempty"` diff --git a/netbox/models/writable_module_type.go b/netbox/models/writable_module_type.go index 4e245167f2..fd61afb40d 100644 --- a/netbox/models/writable_module_type.go +++ b/netbox/models/writable_module_type.go @@ -89,11 +89,11 @@ type WritableModuleType struct { URL strfmt.URI `json:"url,omitempty"` // Weight - Weight *float64 `json:"weight,omitempty"` + Weight *float64 `json:"weight"` // Weight unit // Enum: [kg g lb oz] - WeightUnit string `json:"weight_unit,omitempty"` + WeightUnit string `json:"weight_unit"` } // Validate validates this writable module type diff --git a/netbox/models/writable_power_feed.go b/netbox/models/writable_power_feed.go index dc7c998ea4..ba7d4b0e88 100644 --- a/netbox/models/writable_power_feed.go +++ b/netbox/models/writable_power_feed.go @@ -60,7 +60,7 @@ type WritablePowerFeed struct { // Return the appropriate serializer for the type of connected object. // // Read Only: true - ConnectedEndpoints []*string `json:"connected_endpoints"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` // Connected endpoints reachable // Read Only: true @@ -99,7 +99,7 @@ type WritablePowerFeed struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -108,7 +108,7 @@ type WritablePowerFeed struct { // Mark connected // // Treat as if a cable is connected - MarkConnected bool `json:"mark_connected,omitempty"` + MarkConnected bool `json:"mark_connected"` // Max utilization // @@ -132,7 +132,7 @@ type WritablePowerFeed struct { PowerPanel *int64 `json:"power_panel"` // Rack - Rack *int64 `json:"rack,omitempty"` + Rack *int64 `json:"rack"` // Status // Enum: [offline active planned failed] @@ -147,7 +147,7 @@ type WritablePowerFeed struct { // Type // Enum: [primary redundant] - Type string `json:"type,omitempty"` + Type string `json:"type"` // Url // Read Only: true @@ -689,7 +689,7 @@ func (m *WritablePowerFeed) contextValidateCableEnd(ctx context.Context, formats func (m *WritablePowerFeed) contextValidateConnectedEndpoints(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []*string(m.ConnectedEndpoints)); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []interface{}(m.ConnectedEndpoints)); err != nil { return err } @@ -752,7 +752,7 @@ func (m *WritablePowerFeed) contextValidateLastUpdated(ctx context.Context, form func (m *WritablePowerFeed) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/writable_power_outlet.go b/netbox/models/writable_power_outlet.go index 14781d54b1..fbf5ef9d8d 100644 --- a/netbox/models/writable_power_outlet.go +++ b/netbox/models/writable_power_outlet.go @@ -52,7 +52,7 @@ type WritablePowerOutlet struct { // Return the appropriate serializer for the type of connected object. // // Read Only: true - ConnectedEndpoints []*string `json:"connected_endpoints"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` // Connected endpoints reachable // Read Only: true @@ -86,7 +86,7 @@ type WritablePowerOutlet struct { // // Phase (for three-phase feeds) // Enum: [A B C] - FeedLeg string `json:"feed_leg,omitempty"` + FeedLeg string `json:"feed_leg"` // ID // Read Only: true @@ -107,7 +107,7 @@ type WritablePowerOutlet struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -116,10 +116,10 @@ type WritablePowerOutlet struct { // Mark connected // // Treat as if a cable is connected - MarkConnected bool `json:"mark_connected,omitempty"` + MarkConnected bool `json:"mark_connected"` // Module - Module *int64 `json:"module,omitempty"` + Module *int64 `json:"module"` // Name // Required: true @@ -128,7 +128,7 @@ type WritablePowerOutlet struct { Name *string `json:"name"` // Power port - PowerPort *int64 `json:"power_port,omitempty"` + PowerPort *int64 `json:"power_port"` // tags Tags []*NestedTag `json:"tags"` @@ -137,7 +137,7 @@ type WritablePowerOutlet struct { // // Physical port type // Enum: [iec-60320-c5 iec-60320-c7 iec-60320-c13 iec-60320-c15 iec-60320-c19 iec-60320-c21 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15r nema-5-15r nema-5-20r nema-5-30r nema-5-50r nema-6-15r nema-6-20r nema-6-30r nema-6-50r nema-10-30r nema-10-50r nema-14-20r nema-14-30r nema-14-50r nema-14-60r nema-15-15r nema-15-20r nema-15-30r nema-15-50r nema-15-60r nema-l1-15r nema-l5-15r nema-l5-20r nema-l5-30r nema-l5-50r nema-l6-15r nema-l6-20r nema-l6-30r nema-l6-50r nema-l10-30r nema-l14-20r nema-l14-30r nema-l14-50r nema-l14-60r nema-l15-20r nema-l15-30r nema-l15-50r nema-l15-60r nema-l21-20r nema-l21-30r nema-l22-30r CS6360C CS6364C CS8164C CS8264C CS8364C CS8464C ita-e ita-f ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o ita-multistandard usb-a usb-micro-b usb-c dc-terminal hdot-cx saf-d-grid neutrik-powercon-20a neutrik-powercon-32a neutrik-powercon-true1 neutrik-powercon-true1-top ubiquiti-smartpower hardwired other] - Type string `json:"type,omitempty"` + Type string `json:"type"` // Url // Read Only: true @@ -799,7 +799,7 @@ func (m *WritablePowerOutlet) contextValidateCableEnd(ctx context.Context, forma func (m *WritablePowerOutlet) contextValidateConnectedEndpoints(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []*string(m.ConnectedEndpoints)); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []interface{}(m.ConnectedEndpoints)); err != nil { return err } @@ -862,7 +862,7 @@ func (m *WritablePowerOutlet) contextValidateLastUpdated(ctx context.Context, fo func (m *WritablePowerOutlet) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/writable_power_panel.go b/netbox/models/writable_power_panel.go index e4d32373b0..ffaf85d74c 100644 --- a/netbox/models/writable_power_panel.go +++ b/netbox/models/writable_power_panel.go @@ -64,7 +64,7 @@ type WritablePowerPanel struct { LastUpdated *strfmt.DateTime `json:"last_updated,omitempty"` // Location - Location *int64 `json:"location,omitempty"` + Location *int64 `json:"location"` // Name // Required: true diff --git a/netbox/models/writable_power_port.go b/netbox/models/writable_power_port.go index 8c8cbe4993..2d42b592f4 100644 --- a/netbox/models/writable_power_port.go +++ b/netbox/models/writable_power_port.go @@ -45,7 +45,7 @@ type WritablePowerPort struct { // Allocated power draw (watts) // Maximum: 32767 // Minimum: 1 - AllocatedDraw *int64 `json:"allocated_draw,omitempty"` + AllocatedDraw *int64 `json:"allocated_draw"` // cable Cable *NestedCable `json:"cable,omitempty"` @@ -59,7 +59,7 @@ type WritablePowerPort struct { // Return the appropriate serializer for the type of connected object. // // Read Only: true - ConnectedEndpoints []*string `json:"connected_endpoints"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` // Connected endpoints reachable // Read Only: true @@ -108,7 +108,7 @@ type WritablePowerPort struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -117,17 +117,17 @@ type WritablePowerPort struct { // Mark connected // // Treat as if a cable is connected - MarkConnected bool `json:"mark_connected,omitempty"` + MarkConnected bool `json:"mark_connected"` // Maximum draw // // Maximum power draw (watts) // Maximum: 32767 // Minimum: 1 - MaximumDraw *int64 `json:"maximum_draw,omitempty"` + MaximumDraw *int64 `json:"maximum_draw"` // Module - Module *int64 `json:"module,omitempty"` + Module *int64 `json:"module"` // Name // Required: true @@ -142,7 +142,7 @@ type WritablePowerPort struct { // // Physical port type // Enum: [iec-60320-c6 iec-60320-c8 iec-60320-c14 iec-60320-c16 iec-60320-c20 iec-60320-c22 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15p nema-5-15p nema-5-20p nema-5-30p nema-5-50p nema-6-15p nema-6-20p nema-6-30p nema-6-50p nema-10-30p nema-10-50p nema-14-20p nema-14-30p nema-14-50p nema-14-60p nema-15-15p nema-15-20p nema-15-30p nema-15-50p nema-15-60p nema-l1-15p nema-l5-15p nema-l5-20p nema-l5-30p nema-l5-50p nema-l6-15p nema-l6-20p nema-l6-30p nema-l6-50p nema-l10-30p nema-l14-20p nema-l14-30p nema-l14-50p nema-l14-60p nema-l15-20p nema-l15-30p nema-l15-50p nema-l15-60p nema-l21-20p nema-l21-30p nema-l22-30p cs6361c cs6365c cs8165c cs8265c cs8365c cs8465c ita-c ita-e ita-f ita-ef ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o usb-a usb-b usb-c usb-mini-a usb-mini-b usb-micro-a usb-micro-b usb-micro-ab usb-3-b usb-3-micro-b dc-terminal saf-d-grid neutrik-powercon-20 neutrik-powercon-32 neutrik-powercon-true1 neutrik-powercon-true1-top ubiquiti-smartpower hardwired other] - Type string `json:"type,omitempty"` + Type string `json:"type"` // Url // Read Only: true @@ -816,7 +816,7 @@ func (m *WritablePowerPort) contextValidateCableEnd(ctx context.Context, formats func (m *WritablePowerPort) contextValidateConnectedEndpoints(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []*string(m.ConnectedEndpoints)); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoints", "body", []interface{}(m.ConnectedEndpoints)); err != nil { return err } @@ -879,7 +879,7 @@ func (m *WritablePowerPort) contextValidateLastUpdated(ctx context.Context, form func (m *WritablePowerPort) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/netbox/models/writable_rear_port.go b/netbox/models/writable_rear_port.go index 9079a0103c..3098df22d2 100644 --- a/netbox/models/writable_rear_port.go +++ b/netbox/models/writable_rear_port.go @@ -51,7 +51,7 @@ type WritableRearPort struct { // Color // Max Length: 6 // Pattern: ^[0-9a-f]{6}$ - Color string `json:"color,omitempty"` + Color string `json:"color"` // Created // Read Only: true @@ -92,7 +92,7 @@ type WritableRearPort struct { // Return the appropriate serializer for the link termination model. // // Read Only: true - LinkPeers []*string `json:"link_peers"` + LinkPeers []interface{} `json:"link_peers"` // Link peers type // Read Only: true @@ -101,10 +101,10 @@ type WritableRearPort struct { // Mark connected // // Treat as if a cable is connected - MarkConnected bool `json:"mark_connected,omitempty"` + MarkConnected bool `json:"mark_connected"` // Module - Module *int64 `json:"module,omitempty"` + Module *int64 `json:"module"` // Name // Required: true @@ -660,7 +660,7 @@ func (m *WritableRearPort) contextValidateLastUpdated(ctx context.Context, forma func (m *WritableRearPort) contextValidateLinkPeers(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "link_peers", "body", []*string(m.LinkPeers)); err != nil { + if err := validate.ReadOnly(ctx, "link_peers", "body", []interface{}(m.LinkPeers)); err != nil { return err } diff --git a/preprocess.py b/preprocess.py index db571f8f27..35ad2ab42c 100755 --- a/preprocess.py +++ b/preprocess.py @@ -34,22 +34,25 @@ logging.debug("checking path: " + path) for verb, verb_spec in path_spec.items(): if "parameters" in verb_spec: - tag_locations = [i for i, t in enumerate( - verb_spec["parameters"]) if t["name"] == 'tag'] + tag_locations = [ + i for i, t in enumerate(verb_spec["parameters"]) if t["name"] == "tag" + ] if tag_locations: for tag_location in tag_locations: logging.info( - "Changing tag query to support multiple tags " + path + " " + verb) + "Changing tag query to support multiple tags " + + path + + " " + + verb + ) verb_spec["parameters"][tag_location] = { "name": "tag", "in": "query", "description": "", "required": False, "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" + "items": {"type": "string"}, + "collectionFormat": "multi", } # Second, fix the config contexts and local context data to our needs @@ -93,23 +96,62 @@ prop_spec["x-omitempty"] = False logging.info(f"set x-omitempty = false on WritableIPAddress.{prop}") -for prop, prop_spec in data["definitions"]["WritableRack"]["properties"].items(): - if ( - "x-nullable" in prop_spec - and prop_spec["x-nullable"] == True - and prop_spec["type"] in ["integer", "number"] - ): - prop_spec["x-omitempty"] = False - logging.info(f"set x-omitempty = false on WritableRack.{prop}") - if prop in ["tags", "type", "outer_unit", "weight_unit", "asset_tag", "desc_units", "facility_id"]: - prop_spec["x-omitempty"] = False - logging.info(f"set x-omitempty = false on WritableRack.{prop}") +for model in [ + "WritableRack", + "WritablePowerPanel", + "WritableModuleType", + "WritableRearPort", + "WritablePowerPort", + "WritablePowerOutlet", + "WritablePowerFeed", + "WritableModule", + "WritableModuleBay", + "WritableFrontPort", + "WritableConsoleServerPort", + "WritableConsolePort", + "WritableCable", + "InventoryItemRole", + "WritableInventoryItem", +]: + for prop, prop_spec in data["definitions"][model]["properties"].items(): + if ( + "x-nullable" in prop_spec + and prop_spec["x-nullable"] == True + and prop_spec["type"] in ["integer", "number"] + ): + prop_spec["x-omitempty"] = False + logging.info(f"set x-omitempty = false on {model}.{prop}") + if prop in [ + "tags", + "type", + "outer_unit", + "weight_unit", + "asset_tag", + "desc_units", + "facility_id", + "mark_connected", + "feed_leg", + "color", + "component_type", + "discovered", + ]: + prop_spec["x-omitempty"] = False + logging.info(f"set x-omitempty = false on {model}.{prop}") + +# fix generic objects that are incorrectly listed as strings +for model in data["definitions"]: + for prop, prop_spec in data["definitions"][model]["properties"].items(): + if prop in ["link_peers", "connected_endpoints"]: + prop_spec["items"]["type"] = "object" + logging.info(f"set items.type = object on {model}.{prop}") data["definitions"]["WritableCustomField"]["properties"]["required"][ - "x-omitempty"] = False + "x-omitempty" +] = False data["definitions"]["WritableObjectPermission"]["properties"]["constraints"][ - "x-omitempty"] = False + "x-omitempty" +] = False # This implements https://github.com/fbreckle/go-netbox/commit/1363e14cfc7bce4bd3d5ee93c09ca70543c51279 for prop, prop_spec in data["definitions"]["WritableVirtualMachineWithConfigContext"][ diff --git a/swagger.processed.json b/swagger.processed.json index 50ff3e550f..efc6e6fa21 100644 --- a/swagger.processed.json +++ b/swagger.processed.json @@ -72843,7 +72843,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -72978,7 +72978,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -74185,7 +74185,8 @@ "smf-os2", "aoc", "power" - ] + ], + "x-omitempty": false }, "a_terminations": { "type": "array", @@ -74211,7 +74212,8 @@ "tenant": { "title": "Tenant", "type": "integer", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "label": { "title": "Label", @@ -74222,13 +74224,15 @@ "title": "Color", "type": "string", "pattern": "^[0-9a-f]{6}$", - "maxLength": 6 + "maxLength": 6, + "x-omitempty": false }, "length": { "title": "Length", "type": "number", "format": "decimal", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "length_unit": { "title": "Length unit", @@ -74255,7 +74259,8 @@ "type": "array", "items": { "$ref": "#/definitions/NestedTag" - } + }, + "x-omitempty": false }, "custom_fields": { "title": "Custom fields", @@ -75372,7 +75377,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -75386,7 +75391,7 @@ "description": "\nReturn the appropriate serializer for the type of connected object.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -75463,7 +75468,8 @@ "module": { "title": "Module", "type": "integer", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "name": { "title": "Name", @@ -75497,7 +75503,8 @@ "usb-micro-b", "usb-micro-ab", "other" - ] + ], + "x-omitempty": false }, "speed": { "title": "Speed", @@ -75513,7 +75520,8 @@ 57600, 115200 ], - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "description": { "title": "Description", @@ -75523,7 +75531,8 @@ "mark_connected": { "title": "Mark connected", "description": "Treat as if a cable is connected", - "type": "boolean" + "type": "boolean", + "x-omitempty": false }, "cable": { "$ref": "#/definitions/NestedCable" @@ -75538,7 +75547,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -75552,7 +75561,7 @@ "description": "\nReturn the appropriate serializer for the type of connected object.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -75571,7 +75580,8 @@ "type": "array", "items": { "$ref": "#/definitions/NestedTag" - } + }, + "x-omitempty": false }, "custom_fields": { "title": "Custom fields", @@ -75949,7 +75959,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -75963,7 +75973,7 @@ "description": "\nReturn the appropriate serializer for the type of connected object.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -76040,7 +76050,8 @@ "module": { "title": "Module", "type": "integer", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "name": { "title": "Name", @@ -76074,7 +76085,8 @@ "usb-micro-b", "usb-micro-ab", "other" - ] + ], + "x-omitempty": false }, "speed": { "title": "Speed", @@ -76090,7 +76102,8 @@ 57600, 115200 ], - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "description": { "title": "Description", @@ -76100,7 +76113,8 @@ "mark_connected": { "title": "Mark connected", "description": "Treat as if a cable is connected", - "type": "boolean" + "type": "boolean", + "x-omitempty": false }, "cable": { "$ref": "#/definitions/NestedCable" @@ -76115,7 +76129,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -76129,7 +76143,7 @@ "description": "\nReturn the appropriate serializer for the type of connected object.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -76148,7 +76162,8 @@ "type": "array", "items": { "$ref": "#/definitions/NestedTag" - } + }, + "x-omitempty": false }, "custom_fields": { "title": "Custom fields", @@ -77924,7 +77939,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -77998,7 +78013,8 @@ "module": { "title": "Module", "type": "integer", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "name": { "title": "Name", @@ -78059,13 +78075,15 @@ "urm-p8", "splice", "other" - ] + ], + "x-omitempty": false }, "color": { "title": "Color", "type": "string", "pattern": "^[0-9a-f]{6}$", - "maxLength": 6 + "maxLength": 6, + "x-omitempty": false }, "rear_port": { "title": "Rear port", @@ -78085,7 +78103,8 @@ "mark_connected": { "title": "Mark connected", "description": "Treat as if a cable is connected", - "type": "boolean" + "type": "boolean", + "x-omitempty": false }, "cable": { "$ref": "#/definitions/NestedCable" @@ -78100,7 +78119,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -78114,7 +78133,8 @@ "type": "array", "items": { "$ref": "#/definitions/NestedTag" - } + }, + "x-omitempty": false }, "custom_fields": { "title": "Custom fields", @@ -79948,7 +79968,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -79975,7 +79995,7 @@ "description": "\nReturn the appropriate serializer for the type of connected object.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -80559,7 +80579,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -80591,7 +80611,7 @@ "description": "\nReturn the appropriate serializer for the type of connected object.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -80690,7 +80710,8 @@ "type": "string", "pattern": "^[0-9a-f]{6}$", "maxLength": 6, - "minLength": 1 + "minLength": 1, + "x-omitempty": false }, "description": { "title": "Description", @@ -80701,7 +80722,8 @@ "type": "array", "items": { "$ref": "#/definitions/NestedTag" - } + }, + "x-omitempty": false }, "custom_fields": { "title": "Custom fields", @@ -81130,7 +81152,8 @@ "parent": { "title": "Parent", "type": "integer", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "name": { "title": "Name", @@ -81147,12 +81170,14 @@ "role": { "title": "Role", "type": "integer", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "manufacturer": { "title": "Manufacturer", "type": "integer", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "part_id": { "title": "Part ID", @@ -81170,12 +81195,14 @@ "description": "A unique tag used to identify this item", "type": "string", "maxLength": 50, - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "discovered": { "title": "Discovered", "description": "This item was automatically discovered", - "type": "boolean" + "type": "boolean", + "x-omitempty": false }, "description": { "title": "Description", @@ -81185,13 +81212,15 @@ "component_type": { "title": "Component type", "type": "string", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "component_id": { "title": "Component id", "type": "integer", "minimum": 0, - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "component": { "title": "Component", @@ -81202,7 +81231,8 @@ "type": "array", "items": { "$ref": "#/definitions/NestedTag" - } + }, + "x-omitempty": false }, "custom_fields": { "title": "Custom fields", @@ -81846,7 +81876,8 @@ "type": "array", "items": { "$ref": "#/definitions/NestedTag" - } + }, + "x-omitempty": false }, "custom_fields": { "title": "Custom fields", @@ -82020,7 +82051,8 @@ "title": "Weight", "type": "number", "format": "decimal", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "weight_unit": { "title": "Weight unit", @@ -82030,7 +82062,8 @@ "g", "lb", "oz" - ] + ], + "x-omitempty": false }, "description": { "title": "Description", @@ -82045,7 +82078,8 @@ "type": "array", "items": { "$ref": "#/definitions/NestedTag" - } + }, + "x-omitempty": false }, "custom_fields": { "title": "Custom fields", @@ -82302,7 +82336,8 @@ "description": "A unique tag used to identify this device", "type": "string", "maxLength": 50, - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "description": { "title": "Description", @@ -82317,7 +82352,8 @@ "type": "array", "items": { "$ref": "#/definitions/NestedTag" - } + }, + "x-omitempty": false }, "custom_fields": { "title": "Custom fields", @@ -82754,7 +82790,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -82768,7 +82804,7 @@ "description": "\nReturn the appropriate serializer for the type of connected object.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -82854,7 +82890,8 @@ "rack": { "title": "Rack", "type": "integer", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "name": { "title": "Name", @@ -82878,7 +82915,8 @@ "enum": [ "primary", "redundant" - ] + ], + "x-omitempty": false }, "supply": { "title": "Supply", @@ -82918,7 +82956,8 @@ "mark_connected": { "title": "Mark connected", "description": "Treat as if a cable is connected", - "type": "boolean" + "type": "boolean", + "x-omitempty": false }, "cable": { "$ref": "#/definitions/NestedCable" @@ -82933,7 +82972,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -82947,7 +82986,7 @@ "description": "\nReturn the appropriate serializer for the type of connected object.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -82975,7 +83014,8 @@ "type": "array", "items": { "$ref": "#/definitions/NestedTag" - } + }, + "x-omitempty": false }, "custom_fields": { "title": "Custom fields", @@ -83840,7 +83880,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -83854,7 +83894,7 @@ "description": "\nReturn the appropriate serializer for the type of connected object.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -83931,7 +83971,8 @@ "module": { "title": "Module", "type": "integer", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "name": { "title": "Name", @@ -84040,12 +84081,14 @@ "ubiquiti-smartpower", "hardwired", "other" - ] + ], + "x-omitempty": false }, "power_port": { "title": "Power port", "type": "integer", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "feed_leg": { "title": "Feed leg", @@ -84055,7 +84098,8 @@ "A", "B", "C" - ] + ], + "x-omitempty": false }, "description": { "title": "Description", @@ -84065,7 +84109,8 @@ "mark_connected": { "title": "Mark connected", "description": "Treat as if a cable is connected", - "type": "boolean" + "type": "boolean", + "x-omitempty": false }, "cable": { "$ref": "#/definitions/NestedCable" @@ -84080,7 +84125,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -84094,7 +84139,7 @@ "description": "\nReturn the appropriate serializer for the type of connected object.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -84113,7 +84158,8 @@ "type": "array", "items": { "$ref": "#/definitions/NestedTag" - } + }, + "x-omitempty": false }, "custom_fields": { "title": "Custom fields", @@ -84247,7 +84293,8 @@ "location": { "title": "Location", "type": "integer", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "name": { "title": "Name", @@ -84268,7 +84315,8 @@ "type": "array", "items": { "$ref": "#/definitions/NestedTag" - } + }, + "x-omitempty": false }, "custom_fields": { "title": "Custom fields", @@ -85067,7 +85115,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -85081,7 +85129,7 @@ "description": "\nReturn the appropriate serializer for the type of connected object.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -85158,7 +85206,8 @@ "module": { "title": "Module", "type": "integer", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "name": { "title": "Name", @@ -85274,7 +85323,8 @@ "ubiquiti-smartpower", "hardwired", "other" - ] + ], + "x-omitempty": false }, "maximum_draw": { "title": "Maximum draw", @@ -85282,7 +85332,8 @@ "type": "integer", "maximum": 32767, "minimum": 1, - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "allocated_draw": { "title": "Allocated draw", @@ -85290,7 +85341,8 @@ "type": "integer", "maximum": 32767, "minimum": 1, - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "description": { "title": "Description", @@ -85300,7 +85352,8 @@ "mark_connected": { "title": "Mark connected", "description": "Treat as if a cable is connected", - "type": "boolean" + "type": "boolean", + "x-omitempty": false }, "cable": { "$ref": "#/definitions/NestedCable" @@ -85315,7 +85368,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -85329,7 +85382,7 @@ "description": "\nReturn the appropriate serializer for the type of connected object.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -85348,7 +85401,8 @@ "type": "array", "items": { "$ref": "#/definitions/NestedTag" - } + }, + "x-omitempty": false }, "custom_fields": { "title": "Custom fields", @@ -86775,7 +86829,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -86848,7 +86902,8 @@ "module": { "title": "Module", "type": "integer", - "x-nullable": true + "x-nullable": true, + "x-omitempty": false }, "name": { "title": "Name", @@ -86909,13 +86964,15 @@ "urm-p8", "splice", "other" - ] + ], + "x-omitempty": false }, "color": { "title": "Color", "type": "string", "pattern": "^[0-9a-f]{6}$", - "maxLength": 6 + "maxLength": 6, + "x-omitempty": false }, "positions": { "title": "Positions", @@ -86931,7 +86988,8 @@ "mark_connected": { "title": "Mark connected", "description": "Treat as if a cable is connected", - "type": "boolean" + "type": "boolean", + "x-omitempty": false }, "cable": { "$ref": "#/definitions/NestedCable" @@ -86946,7 +87004,7 @@ "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "array", "items": { - "type": "string", + "type": "object", "x-nullable": true }, "readOnly": true @@ -86960,7 +87018,8 @@ "type": "array", "items": { "$ref": "#/definitions/NestedTag" - } + }, + "x-omitempty": false }, "custom_fields": { "title": "Custom fields",